Skip to content

refactor: rename init-aks-custom-cloud -> init-aks-cloud#8875

Merged
awesomenix merged 1 commit into
mainfrom
rchinchani/rcv1p-cleanup
Jul 17, 2026
Merged

refactor: rename init-aks-custom-cloud -> init-aks-cloud#8875
awesomenix merged 1 commit into
mainfrom
rchinchani/rcv1p-cleanup

Conversation

@rchincha

Copy link
Copy Markdown
Contributor

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 #

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.

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.shinit-aks-cloud.sh, plus corresponding Go template keys and filepaths).
  • Renamed Windows cert-endpoint mode helper (Get-CustomCloudCertEndpointModeFromLocationGet-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.

Comment thread pkg/agent/const.go Outdated
Copilot AI review requested due to automatic review settings July 10, 2026 03:28
@rchincha
rchincha force-pushed the rchinchani/rcv1p-cleanup branch from 7ffff64 to 91bd562 Compare July 10, 2026 03:31

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.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Comment thread pkg/agent/const.go Outdated
Copilot AI review requested due to automatic review settings July 10, 2026 03:32

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.

Pull request overview

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

@rchincha
rchincha marked this pull request as draft July 10, 2026 03:36
@awesomenix
awesomenix force-pushed the rchinchani/rcv1p-cleanup branch from 91bd562 to 9aa6c90 Compare July 17, 2026 15:30
@awesomenix
awesomenix marked this pull request as ready for review July 17, 2026 15:31
Copilot AI review requested due to automatic review settings July 17, 2026 15:31
@awesomenix
awesomenix force-pushed the rchinchani/rcv1p-cleanup branch from 9aa6c90 to 524e5f1 Compare July 17, 2026 15:35

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.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.

Comment on lines +23 to +26
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;
Comment on lines +6 to +9
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;

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.

might be worth adding?

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.

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

Copilot AI review requested due to automatic review settings July 17, 2026 15:37

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.

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 CustomCloudEnv populated, 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",
		}

Comment on lines +28 to +35
{{if IsAKSCustomCloud}}
- path: {{GetInitAKSCloudFilepath}}
permissions: "0744"
encoding: gzip
owner: root
content: !!binary |
{{GetVariableProperty "cloudInitData" "initAKSCustomCloud"}}
{{GetVariableProperty "cloudInitData" "initAKSCloud"}}
{{end}}

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.

yes thats the plan

Copilot AI review requested due to automatic review settings July 17, 2026 17:40
@awesomenix
awesomenix force-pushed the rchinchani/rcv1p-cleanup branch from 524e5f1 to 731ca56 Compare July 17, 2026 17:40

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.

Pull request overview

Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.

Comment on lines +28 to 32
{{if IsAKSCustomCloud}}
- path: {{GetInitAKSCloudFilepath}}
permissions: "0744"
encoding: gzip
owner: root
Copilot AI review requested due to automatic review settings July 17, 2026 18:46
@awesomenix
awesomenix force-pushed the rchinchani/rcv1p-cleanup branch from 731ca56 to 8dd25ba Compare July 17, 2026 18:46

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.

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.

Comment on lines 27 to 35
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}}

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.

is this to mitigate the customdata size issue? I'd figure at this point we should be writing this file out in all cases

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.

Yeah! also because old VHD has incorrect file in CustomCloud, preferred to keep it for now or few months

@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 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>
Copilot AI review requested due to automatic review settings July 17, 2026 20:42
@awesomenix
awesomenix force-pushed the rchinchani/rcv1p-cleanup branch from 8dd25ba to 40527f8 Compare July 17, 2026 20:42

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.

Pull request overview

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

@awesomenix
awesomenix merged commit 44a8c65 into main Jul 17, 2026
40 of 45 checks passed
@awesomenix
awesomenix deleted the rchinchani/rcv1p-cleanup branch July 17, 2026 22:11
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.

5 participants