refactor: rename init-aks-custom-cloud -> init-aks-cloud#8875
Conversation
e82c52f to
7ffff64
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors naming around the Linux init script (and the Windows helper it aligns with) to reflect that it now runs across all clouds, updating all call sites and generated artifacts accordingly (Packer/VHD build, AgentBaker templates, aks-node-controller parser templates, and test snapshots).
Changes:
- Renamed Linux init script and updated all runtime/template references (
init-aks-custom-cloud.sh→init-aks-cloud.sh, plus corresponding Go template keys and filepaths). - Renamed Windows cert-endpoint mode helper (
Get-CustomCloudCertEndpointModeFromLocation→Get-CertEndpointModeFromLocation) and updated Pester tests. - Updated VHD/Packer file mappings and regenerated affected aks-node-controller parser testdata.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vhdbuilder/packer/vhd-image-builder-mariner.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-mariner-cvm.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-mariner-arm64.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-cvm.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-base.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-arm64-gen2.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-arm64-gb.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-acl.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/vhd-image-builder-acl-arm64.json | Update file provisioner mapping to new init script name. |
| vhdbuilder/packer/packer_source.sh | Rename init script copy variables and destination path. |
| vhdbuilder/packer/imagecustomizer/azlosguard/azlosguard.yml | Update OSGuard file copy list to the new init script name. |
| staging/cse/windows/kubernetesfunc.ps1 | Rename cert endpoint mode helper and update call sites. |
| staging/cse/windows/kubernetesfunc.tests.ps1 | Update Pester tests to target the renamed helper. |
| parts/linux/cloud-init/artifacts/init-aks-cloud.sh | New/renamed init script containing cert bootstrap + repo depot init logic and refresh scheduling. |
| spec/parts/linux/cloud-init/artifacts/init_aks_cloud_spec.sh | Update ShellSpec wiring test to reference new script name/path. |
| parts/linux/cloud-init/nodecustomdata.yml | Update template write_files entry and cloudInitData key to the new init script identifiers. |
| parts/linux/cloud-init/artifacts/cse_cmd.sh | Update generated CSE command to invoke the renamed init script path. |
| pkg/agent/const.go | Rename init script constant and filepath constant. |
| pkg/agent/variables.go | Rename cloudInitData key from initAKSCustomCloud to initAKSCloud. |
| pkg/agent/baker.go | Rename template function GetInitAKS*Filepath exposed to templates. |
| pkg/agent/baker_test.go | Update tests asserting init script presence in rendered custom data. |
| hack/hotfix_generate.py | Update hotfix script mapping key/name for the renamed init script. |
| aks-node-controller/parser/consts.go | Update init script filepath constant used by parser templates. |
| aks-node-controller/parser/helper.go | Rename helper func exposed into parser templates. |
| aks-node-controller/parser/templates/cse_cmd.sh.gtpl | Update parser template to call renamed init script filepath helper. |
| aks-node-controller/parser/testdata/Compatibility+EmptyConfig/generatedCSECommand | Regenerated snapshot reflecting new init script path. |
| aks-node-controller/parser/testdata/AKSUbuntu2204+CustomCloud/generatedCSECommand | Regenerated snapshot reflecting new init script path. |
| aks-node-controller/parser/testdata/AKSUbuntu2204+Containerd+MIG/generatedCSECommand | Regenerated snapshot reflecting new init script path. |
7ffff64 to
91bd562
Compare
91bd562 to
9aa6c90
Compare
9aa6c90 to
524e5f1
Compare
| INIT_AKS_CLOUD_FILEPATH="{{GetInitAKSCloudFilepath}}"; | ||
| if [ -f "${INIT_AKS_CLOUD_FILEPATH}" ]; then | ||
| "${INIT_AKS_CLOUD_FILEPATH}" >> /var/log/azure/cluster-provision.log 2>&1 || exit $?; | ||
| fi; |
| INIT_AKS_CLOUD_FILEPATH="{{getInitAKSCloudFilepath}}"; | ||
| if [ -f "${INIT_AKS_CLOUD_FILEPATH}" ]; then | ||
| "${INIT_AKS_CLOUD_FILEPATH}" >> /var/log/azure/cluster-provision.log 2>&1 || exit $?; | ||
| fi; |
There was a problem hiding this comment.
might be worth adding?
There was a problem hiding this comment.
reason why i didnt add was that this file is present in public cloud VHD (old VHD) and we will end up accidenlty executing incorrect script in public cloud
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
pkg/agent/baker_test.go:1724
- The scriptless init-script assertions only run with
CustomCloudEnvpopulated, so they don't cover the non-custom-cloud (public cloud) scriptless path. That makes it easy for a template guard like{{if IsAKSCustomCloud}}to slip in without tests catching it.
config.ContainerService.Properties.CustomCloudEnv = &datamodel.CustomCloudEnv{
Name: "akscustom",
}
| {{if IsAKSCustomCloud}} | ||
| - path: {{GetInitAKSCloudFilepath}} | ||
| permissions: "0744" | ||
| encoding: gzip | ||
| owner: root | ||
| content: !!binary | | ||
| {{GetVariableProperty "cloudInitData" "initAKSCustomCloud"}} | ||
| {{GetVariableProperty "cloudInitData" "initAKSCloud"}} | ||
| {{end}} |
524e5f1 to
731ca56
Compare
| {{if IsAKSCustomCloud}} | ||
| - path: {{GetInitAKSCloudFilepath}} | ||
| permissions: "0744" | ||
| encoding: gzip | ||
| owner: root |
731ca56 to
8dd25ba
Compare
| func isExpectedDiffCSEVar(key string) bool { | ||
| switch key { | ||
| case "CLOUD_INIT_STATUS_SCRIPT", | ||
| "HYPERKUBE_URL", | ||
| "MCR_REPOSITORY_BASE", | ||
| "BLOCK_OUTBOUND_NETWORK", | ||
| "REPO_DEPOT_ENDPOINT", | ||
| "SKIP_WAAGENT_HOLD": | ||
| return true |
| Example: {{GetCSEHelpersScriptFilepath}} | ||
|
|
||
| - path: {{GetInitAKSCustomCloudFilepath}} | ||
| {{if IsAKSCustomCloud}} |
There was a problem hiding this comment.
is this to mitigate the customdata size issue? I'd figure at this point we should be writing this file out in all cases
There was a problem hiding this comment.
Yeah! also because old VHD has incorrect file in CustomCloud, preferred to keep it for now or few months
AgentBaker Linux gate detectiveRun: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172719934 Failed job/stage/task: e2e / Run AgentBaker E2E / LocalDNSHostsPlugin_Scriptless VM validation Detective summary: The E2E gate again failed on this PR with LocalDNSHostsPlugin_Scriptless variants failing VM validation across multiple OS variants. Scenario logs were extracted for follow-up. Likely cause/signature: LocalDNS scriptless VM validation failure after the init-aks-cloud rename path. Wiki signature: e2e-localdns-hostsplugin-scriptless-vm-validation-fail. Confidence: Medium that this is PR-adjacent/actionable because the same signature recurred on this PR; exact assertion still needs scenario-log review. Recommended owner/action: Please inspect the extracted LocalDNSHostsPlugin_Scriptless scenario logs and verify the rename did not break scriptless init/cloud-init/localdns setup paths. Strongest alternative: Shared E2E infra/private-DNS flake. Less likely as the primary signal because the visible first failures cluster around LocalDNS scriptless VM validation; keep infra as an alternative until scenario logs are checked. Evidence:
|
The init script and its Windows cert-endpoint helper were originally custom-cloud-only, but after PR #8096 (RCV1P cert bootstrap unification) they now run on every cloud - the "custom" in the name is misleading and was flagged in review (cameronmeissner, thread r3250099104). Renames (scope: files/identifiers that are no longer custom-cloud-specific): parts/linux/cloud-init/artifacts/init-aks-custom-cloud.sh -> init-aks-cloud.sh spec/parts/linux/cloud-init/artifacts/init_aks_custom_cloud_spec.sh -> init_aks_cloud_spec.sh Go: initAKSCustomCloud{Script,Filepath} -> initAKSCloud{Script,Filepath} getInitAKSCustomCloudFilepath (helper) -> getInitAKSCloudFilepath GetInitAKSCustomCloudFilepath (tmpl) -> GetInitAKSCloudFilepath cloudInitData key "initAKSCustomCloud" -> "initAKSCloud" PowerShell: Get-CustomCloudCertEndpointModeFromLocation -> Get-CertEndpointModeFromLocation (+ Pester tests updated) VHD/Packer: INIT_CUSTOM_CLOUD_{SRC,DEST} -> INIT_CLOUD_{SRC,DEST} 9x vhd-image-builder-*.json file map entries azlosguard.yml, hotfix_generate.py path strings Regenerated 3 aks-node-controller CSE testdata snapshots (AKSUbuntu2204+Containerd+MIG, AKSUbuntu2204+CustomCloud, Compatibility+EmptyConfig) via GENERATE_TEST_DATA=true. Deliberately NOT renamed - these still refer to the genuine AKS Custom Cloud concept (Azure Stack / sovereign / national clouds): IsAKSCustomCloud, AKSCustomCloudSpec, configureCustomCloud, CustomCloudContainerRegistryDNSSuffix, custom_cloud_config.proto, AKSUbuntu2204+CustomCloud test scenario. Validation: all 245 Ginkgo specs in pkg/agent pass; parser testdata regenerated cleanly. Pre-existing TestCSEScriptRoundTrip Windows-only tempdir failures are unrelated (present on clean main). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8dd25ba to
40527f8
Compare
The init script and its Windows cert-endpoint helper were originally custom-cloud-only, but after PR #8096 (RCV1P cert bootstrap unification) they now run on every cloud - the "custom" in the name is misleading and was flagged in review (cameronmeissner, thread r3250099104).
Renames (scope: files/identifiers that are no longer custom-cloud-specific):
parts/linux/cloud-init/artifacts/init-aks-custom-cloud.sh
-> init-aks-cloud.sh
spec/parts/linux/cloud-init/artifacts/init_aks_custom_cloud_spec.sh
-> init_aks_cloud_spec.sh
Go:
initAKSCustomCloud{Script,Filepath} -> initAKSCloud{Script,Filepath}
getInitAKSCustomCloudFilepath (helper) -> getInitAKSCloudFilepath
GetInitAKSCustomCloudFilepath (tmpl) -> GetInitAKSCloudFilepath
cloudInitData key "initAKSCustomCloud" -> "initAKSCloud"
PowerShell:
Get-CustomCloudCertEndpointModeFromLocation
-> Get-CertEndpointModeFromLocation
(+ Pester tests updated)
VHD/Packer:
INIT_CUSTOM_CLOUD_{SRC,DEST} -> INIT_CLOUD_{SRC,DEST}
9x vhd-image-builder-*.json file map entries
azlosguard.yml, hotfix_generate.py path strings
Regenerated 3 aks-node-controller CSE testdata snapshots (AKSUbuntu2204+Containerd+MIG, AKSUbuntu2204+CustomCloud, Compatibility+EmptyConfig) via GENERATE_TEST_DATA=true.
Deliberately NOT renamed - these still refer to the genuine AKS Custom Cloud concept (Azure Stack / sovereign / national clouds):
IsAKSCustomCloud, AKSCustomCloudSpec, configureCustomCloud,
CustomCloudContainerRegistryDNSSuffix, custom_cloud_config.proto,
AKSUbuntu2204+CustomCloud test scenario.
Validation: all 245 Ginkgo specs in pkg/agent pass; parser testdata regenerated cleanly. Pre-existing TestCSEScriptRoundTrip Windows-only tempdir failures are unrelated (present on clean main).
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #