test(scriptless): Enable scriptless phase 3 in AB e2es#8453
test(scriptless): Enable scriptless phase 3 in AB e2es#8453
Conversation
PR Title Lint Failed ❌Current Title: Your PR title doesn't follow the expected format. Please update your PR title to follow one of these patterns: Conventional Commits Format:
Guidelines:
Examples:
Please update your PR title and the lint check will run again automatically. |
There was a problem hiding this comment.
Pull request overview
Enables “scriptless phase 3” coverage in the AgentBaker e2e suite by adding a new scriptless_anc subtest path that provisions nodes using AKSNodeConfig/aks-node-controller, plus wiring many existing scenarios to provide an AKSNodeConfigMutator.
Changes:
- Added a new
scriptless_ancsubtest variant and runtime flag (EnableScriptlessANC) to drive scriptless phase-3 execution. - Refactored/expanded the e2e “aks-node-controller hack” customData generation to optionally include AKSNodeConfig and/or an nbc-cmd script.
- Updated many scenarios to set equivalent
AKSNodeConfigMutatorfields alongside existing NBC mutators.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| e2e/vmss.go | Refactors customData hack generation and wires scriptless ANC + NBC cmd hack paths into VMSS creation. |
| e2e/types.go | Adds EnableScriptlessANC and adjusts kubelet-config-file detection logic for scriptless ANC scenarios. |
| e2e/test_helpers.go | Adds scriptless_anc subtest generation and new gating helper. |
| e2e/scenario_test.go | Adds AKSNodeConfigMutator coverage across many existing scenarios. |
| func supportsScriptlessNBCCSECmd(s *Scenario) bool { | ||
| return s.AKSNodeConfigMutator == nil && !s.IsWindows() && len(s.Config.CustomDataWriteFiles) <= 0 && !s.VHDCaching && !config.Config.TestPreProvision && !s.SkipScriptlessNBC | ||
| return !s.Tags.Scriptless && !s.IsWindows() && len(s.Config.CustomDataWriteFiles) <= 0 && !s.VHDCaching && !config.Config.TestPreProvision && !s.SkipScriptlessNBC | ||
| } | ||
|
|
||
| func supportsScriptlessAKSNodeConfig(s *Scenario) bool { | ||
| return s.AKSNodeConfigMutator != nil && !s.IsWindows() && len(s.Config.CustomDataWriteFiles) <= 0 && !s.VHDCaching && !config.Config.TestPreProvision | ||
| } |
| if s.Runtime.AKSNodeConfig != nil { | ||
| aksNodeConfigJSON, err := nodeconfigutils.MarshalConfigurationV1(s.Runtime.AKSNodeConfig) | ||
| if err != nil { | ||
| return "", fmt.Errorf("failed to marshal nbc, error: %w", err) |
…scriptless/phase-3-e2e
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
aks-node-controller/app.go:476
- Passing both
--provision-configand--nbc-cmdcurrently triggerscompareEnvs, but the function then proceeds to execute the NBC script (because NBCCmd is prioritized) and does not provision from the AKSNodeConfig. If phase 3 intends to compare envs but still provision via ProvisionConfig, the command-selection logic needs to be adjusted (or a separate flag introduced) so both inputs can be present without changing provisioning behavior.
// If both flags are provided, compare environments before proceeding.
// This is best-effort and should not block provisioning.
if flags.ProvisionConfig != "" && flags.NBCCmd != "" {
slog.Info("ProvisionConfig and NBCCmd both provided, comparing envs")
compareEnvs(ctx, flags, a.eventLogger)
}
var cmd *exec.Cmd
if flags.NBCCmd != "" {
if err := applyNodeCustomData(a.getNodeCustomDataPath()); err != nil {
provisionResult.ExitCode = strconv.Itoa(240)
provisionResult.Error = err.Error()
return provisionResult, err
}
var err error
cmd, err = buildCmdFromNBCCmd(ctx, flags.NBCCmd)
if err != nil {
provisionResult.ExitCode = strconv.Itoa(240)
provisionResult.Error = err.Error()
return provisionResult, err
}
}
// If NBC command is provided, we prioritize it over the aks node config for provisioning.
if flags.ProvisionConfig != "" && flags.NBCCmd == "" {
var err error
| var flags []string | ||
| var encodedNBCCSECmd string | ||
| if s.Runtime.AKSNodeConfig != nil { | ||
| flags = append(flags, "--provision-config="+configPath) | ||
| } | ||
| if nbcCmdScript != "" { | ||
| flags = append(flags, "--nbc-cmd="+nbcCmdPath) | ||
| encodedNBCCSECmd = base64.StdEncoding.EncodeToString([]byte(nbcCmdScript)) |
What this PR does / why we need it:
Enables scriptless phase 3 in ab e2es
Which issue(s) this PR fixes:
Fixes #