Skip to content

fix: init aks cloud, remove exit code, dont install unnecessary packages - #9173

Open
Nishchay (awesomenix) wants to merge 1 commit into
mainfrom
nishp/revert-erofs/main
Open

fix: init aks cloud, remove exit code, dont install unnecessary packages#9173
Nishchay (awesomenix) wants to merge 1 commit into
mainfrom
nishp/revert-erofs/main

Conversation

@awesomenix

Copy link
Copy Markdown
Contributor

Problems:

  1. In AGC seems like we used to always swallow errors, simulate that
  2. If CA refresh is not required dont continue script

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   12 suites   1m 5s ⏱️
389 tests 389 ✅ 0 💤 0 ❌
392 runs  392 ✅ 0 💤 0 ❌

Results for commit 9c00416.

♻️ This comment has been updated with latest results.

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 adjusts the AKS custom-cloud initialization flow used by cloud-init/CSE, aiming to (1) avoid continuing when CA refresh isn’t required and (2) change error-handling behavior to better match historical custom-cloud behavior.

Changes:

  • Updated init-aks-cloud.sh to exit early when install_ca_refresh_schedule is not enabled and to always (re)write the ca-refresh schedule when enabled.
  • Updated cse_cmd.sh to stop propagating init-aks-cloud.sh failures back to the overall provisioning command.

Reviewed changes

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

File Description
parts/linux/cloud-init/artifacts/init-aks-cloud.sh Changes the CA refresh gating and schedule installation behavior in the custom-cloud init script.
parts/linux/cloud-init/artifacts/cse_cmd.sh Changes how failures from the custom-cloud init script affect provisioning (removes immediate exit on error).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 634 to 636
if [ "$install_ca_refresh_schedule" -eq 0 ]; then
exit 0
fi
Comment thread parts/linux/cloud-init/artifacts/cse_cmd.sh
Copilot AI review requested due to automatic review settings August 11, 2026 18:01

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 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

parts/linux/cloud-init/artifacts/init-aks-cloud.sh:642

  • ShellSpec wiring tests under spec/parts/linux/cloud-init/artifacts/init_aks_cloud_spec.sh assert the old structure (explicit if [ "$action" = "ca-refresh" ]; then, plain exit, and gating cron/systemd setup with if [ "$install_ca_refresh_schedule" -eq 1 ]; then). With the new combined early-exit condition and unconditional schedule setup (after exiting when install_ca_refresh_schedule=0), those grep-based tests will fail unless updated to match the new structure.
# In ca-refresh mode (invoked by the scheduled cron/systemd task with the location as arg),
# only the cert refresh above is needed; exit before running the full init path.
# Action values:
# - init (default): full provisioning path
# - ca-refresh <location>: periodic refresh path; location is passed as arg to avoid env dependency
action=${1:-init}
if [ "$action" = "ca-refresh" ] || [ "$install_ca_refresh_schedule" -eq 0 ]; then
    exit 0
fi

parts/linux/cloud-init/artifacts/init-aks-cloud.sh:642

  • This early-exit now triggers not only for ca-refresh but also when install_ca_refresh_schedule is 0; the preceding comment still says only ca-refresh exits before the full init path, which is now misleading.
action=${1:-init}
if [ "$action" = "ca-refresh" ] || [ "$install_ca_refresh_schedule" -eq 0 ]; then
    exit 0
fi

Copilot AI review requested due to automatic review settings August 11, 2026 18:40
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