Skip to content

feat: select Edge Zone galleries using shared distro identities - #10033

Open
prakhar1200 wants to merge 1 commit into
mainfrom
prakhardoshi/edgezone-gallery-context
Open

prakhar1200 wants to merge 1 commit into
mainfrom
prakhardoshi/edgezone-gallery-context

Conversation

@prakhar1200

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Alternative to #9689 for comparison. These are separate approaches, not PRs intended to merge together.

Use the existing regional distro identity and select the Extended Zone gallery through explicit lookup context, rather than deriving additional Edge Zone distro names.

Original PR #9689 This alternative
Distro identity Derived Edge Zone identities Existing regional identities
Gallery selection Distro identity UseEdgeZoneVHD lookup context
Classification Normalize derived identities Existing classification unchanged
Migration Keep existing Edge Zone naming Support shared and legacy identities together

For example:

image, err := baker.GetLatestSigImageConfig(
    sigConfig,
    datamodel.AKSUbuntuContainerd2404Gen2,
    &datamodel.EnvironmentInfo{
        Region: region,
        UseEdgeZoneVHD: true,
    },
)

The distro remains aks-ubuntu-containerd-24.04-gen2; the image definition remains 2404gen2containerd. The context selects the Extended Zone gallery and resource group, preserving the regional configuration's other metadata.

Changes:

  • Derive the shared-name Extended Zone catalog from configured standard Ubuntu and Azure Linux v3+ regional entries. Exclude specialized variants such as FIPS, ARM64, CVM, Kata, Trusted Launch, and Minimal.
  • Export IsEdgeZoneDistro and IsEdgeZoneSIGImage for downstream validation and publishing eligibility checks.
  • Add optional UseEdgeZoneVHD context to environment and bootstrapping configuration without changing public method signatures.
  • Apply context to latest-image lookup, catalog enumeration, and node bootstrapping. Explicit Extended Zone bootstrapping does not return a regional marketplace image.
  • Prefer shared-name configuration, with fallback only to legacy Extended Zone configuration. Unsupported inputs fail rather than returning a regional image. This is configuration lookup fallback, not an Azure image-availability probe.
  • Preserve default behavior for callers that do not opt in, including legacy distro lookups. Keep legacy distro-keyed version overrides authoritative while shared-name callers migrate.

The only types.go change is the optional context field; distro classification logic is unchanged.

Scope and rollout

AgentBaker only. RP must adopt the new module, keep/select the regional distro identity, and pass the Extended Zone context. Publisher and RP adoption are not included here. Existing nodes do not automatically change images or upgrade.

Catalog eligibility is not proof of publication or replication. Extended Zone target configuration and image publishing must still happen before enabling use; this PR adds no runtime availability service or readiness gate.

Validation

  • Focused datamodel suites: shared catalog, cloud configuration, and maintained Linux catalog.
  • Entire AgentBaker API implementation suite, including shared/legacy routing, version overrides, unsupported images, and bootstrapping.
  • Repository-pinned golangci-lint v2.14.0, changed-code checks across ./pkg/agent/...: passed.
  • git diff --check: passed.

Validation used Go 1.26.0. An initial broader agent-package invocation also ran unrelated Bash-dependent tests and failed because this Windows host has no installed WSL distribution. The API suite was then selected with -run '^TestUtils$' and passed. Full Linux/Bash suites and downstream RP/publisher integration were not validated.

Which issue(s) this PR fixes:

No linked issue. Comparison alternative to #9689.

Add explicit Extended Zone lookup context with shared distro identities, legacy configuration fallback, and migration-safe version overrides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21bda48d-395d-41e0-9bba-14f30a71e533
@prakhar1200
prakhar1200 requested review from a team as code owners November 10, 2026 01:08
Copilot AI balanced review requested due to automatic review settings November 10, 2026 01:08
@github-actions

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   1m 3s ⏱️
789 tests 789 ✅ 0 💤 0 ❌
815 runs  815 ✅ 0 💤 0 ❌

Results for commit d2bd2f1.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 71% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 73% ➖
Summary 39% (1983 / 7220) ❌

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The HTTP handlers ignore the Edge Zone opt-in, while the fallback accepts an unsupported Egress distro and selects the legacy Edge Zone image instead of rejecting it.

2 open issues
What changed in this PR

This PR adds explicit Extended Zone gallery selection while retaining existing regional distro identities. It offers an alternative to #9689’s derived-identity approach and preserves legacy lookups.

Changes:

  • Derives a shared-name Extended Zone catalog and exports eligibility helpers.
  • Adds UseEdgeZoneVHD context to image lookup, catalog enumeration, and node bootstrapping.
  • Adds tests for gallery routing, legacy fallback, version overrides, and unsupported images.
File Description
pkg/​agent/​datamodel/​types.go Adds optional Extended Zone bootstrapping context.
pkg/​agent/​datamodel/​sig_config.go Defines the shared catalog, eligibility helpers, and lookup context.
pkg/​agent/​datamodel/​sig_config_test.go Tests catalog eligibility and metadata preservation.
pkg/​agent/​bakerapi.go Routes image selection through shared and legacy Extended Zone configurations.
pkg/​agent/​bakerapi_test.go Tests routing, overrides, fallback, and bootstrapping behavior.

Review effort: Balanced

Comment thread pkg/agent/bakerapi.go
return &legacyConfig
}
regionalConfig, ok := catalog.regional[distro]
if !ok {
Comment on lines +47 to +48
// UseEdgeZoneVHD selects the Extended Zone gallery without changing the distro identity.
UseEdgeZoneVHD bool `json:"useEdgeZoneVHD,omitempty"`
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 30% ❌
Summary 30% (4912 / 16591) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 73% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 92% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
github.com/Azure/agentbaker/apiserver 24% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 35% ❌
github.com/Azure/agentbaker/pkg/agent 80% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 78% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
Summary 76% (6200 / 8147) ➖

This branch has not been deployed

No deployments
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.

2 participants