fix: init aks cloud, remove exit code, dont install unnecessary packages - #9173
fix: init aks cloud, remove exit code, dont install unnecessary packages#9173Nishchay (awesomenix) wants to merge 1 commit into
Conversation
Windows Unit Test Results 3 files 12 suites 1m 5s ⏱️ Results for commit 9c00416. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
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.shto exit early wheninstall_ca_refresh_scheduleis not enabled and to always (re)write the ca-refresh schedule when enabled. - Updated
cse_cmd.shto stop propagatinginit-aks-cloud.shfailures 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.
| if [ "$install_ca_refresh_schedule" -eq 0 ]; then | ||
| exit 0 | ||
| fi |
94db44e to
060e3cf
Compare
There was a problem hiding this comment.
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, plainexit, and gating cron/systemd setup withif [ "$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-refreshbut also wheninstall_ca_refresh_scheduleis 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
060e3cf to
9c00416
Compare
Problems: