Skip to content

feat: add OSSKU-based IsCgroupV2 detection and CustomizedImageTrustedLaunch distro#8252

Open
aadhar-agarwal wants to merge 1 commit intomainfrom
aadagarwal/cgroupv2-byoi
Open

feat: add OSSKU-based IsCgroupV2 detection and CustomizedImageTrustedLaunch distro#8252
aadhar-agarwal wants to merge 1 commit intomainfrom
aadagarwal/cgroupv2-byoi

Conversation

@aadhar-agarwal
Copy link
Copy Markdown
Contributor

@aadhar-agarwal aadhar-agarwal commented Apr 8, 2026

What this PR does:
Fixes cgroupv2 detection for BYOI scenarios and adds the CustomizedImageTrustedLaunch distro.

Changes:

  • IsCgroupV2: Add explicit config.OSSKU == OSSKUAzureLinux check and switch Flatcar/ACL detection from profile.Is*() (distro-based, always false for customized images) to config.Is*() (OSSKU-based)
  • Add unit tests for cgroupv2 detection
  • CustomizedImageTrustedLaunch: New distro constant

Why do we need it:

  • BYOI nodes using AzureLinux/Flatcar/ACL images were not getting NEEDS_CGROUPV2=true because the distro-level helpers return false for customized images

  • Adding CustomizedImageTrustedLaunch as a distro avoids needing separate customized image distro constants for an OS variant to support trusted launch. (for eg. CustomizedImageACL)

    • This is a similar change to adding support for CustomizedImageLinuxGuard (in AgentBaker and aks-rp)

Which issue(s) this PR fixes:
Fixes #7999

Testing:

Copilot AI review requested due to automatic review settings April 8, 2026 22:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes IsCgroupV2 template detection for BYOI/customized-image scenarios by switching Flatcar/ACL checks to OSSKU-based helpers and explicitly handling AzureLinux OSSKU, and it introduces a new CustomizedImageTrustedLaunch distro to represent trusted-launch customized images without proliferating per-OS custom distro constants.

Changes:

  • Update IsCgroupV2 to use config.IsFlatcar() / config.IsACL() (OSSKU-aware) and add an explicit OSSKUAzureLinux check.
  • Add CustomizedImageTrustedLaunch distro and treat it as a “custom image” in bootstrapping flows.
  • Add unit tests covering cgroupv2 detection for customized images and bootstrapping behavior for the new distro.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/agent/datamodel/types.go Adds the CustomizedImageTrustedLaunch distro constant.
pkg/agent/bakerapi.go Treats CustomizedImageTrustedLaunch like other customized images (bypasses SIG/PIR image lookup).
pkg/agent/bakerapi_test.go Adds coverage ensuring bootstrapping doesn’t error for CustomizedImageTrustedLaunch.
pkg/agent/baker.go Updates IsCgroupV2 to be OSSKU-aware for AzureLinux/Flatcar/ACL; includes new distro in IsCustomImage.
pkg/agent/baker_test.go Adds tests asserting NEEDS_CGROUPV2=true for customized-image + OSSKU combinations.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsCgroupV2 template function uses profile-only detection, missing CustomizedImage + OSSKU scenarios

3 participants