Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the oras CLI invocation path in Linux CSE helpers (regressed when components were moved to /opt/bin in #7125) and updates generated CustomData snapshots accordingly.
Changes:
- Define
ORAS=/opt/bin/orasand use it fororas pull/cp/login/logout/repo lscalls incse_helpers.sh. - Regenerate/update
pkg/agent/testdata/**/CustomDatasnapshots to reflect the script change.
Reviewed changes
Copilot reviewed 38 out of 66 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| parts/linux/cloud-init/artifacts/cse_helpers.sh | Introduces ORAS path variable and updates oras command invocations to use it. |
| pkg/agent/testdata/MarinerV2+Kata/CustomData | Snapshot update after script change. |
| pkg/agent/testdata/MarinerV2+CustomCloud/CustomData | Snapshot update after script change. |
| pkg/agent/testdata/CustomizedImageLinuxGuard/CustomData | Snapshot update after script change. |
| pkg/agent/testdata/CustomizedImageKata/CustomData | Snapshot update after script change. |
| pkg/agent/testdata/CustomizedImage/CustomData | Snapshot update after script change. |
| FLATCAR_OS_NAME="FLATCAR" | ||
| AZURELINUX_OSGUARD_OS_VARIANT="OSGUARD" | ||
| KUBECTL=/opt/bin/kubectl | ||
| ORAS=/opt/bin/oras |
There was a problem hiding this comment.
Hardcoding ORAS=/opt/bin/oras can break backward compatibility when newer CSE scripts run on older VHDs that may still have oras in a different location (e.g., /usr/local/bin/PATH). Consider resolving ORAS dynamically (prefer /opt/bin/oras when present, otherwise fall back to command -v oras/known legacy paths) and fail with a clear error if no binary is found.
| ORAS=/opt/bin/oras | |
| # Resolve ORAS dynamically to maintain compatibility across VHDs. | |
| if [ -x /opt/bin/oras ]; then | |
| ORAS=/opt/bin/oras | |
| elif command -v oras >/dev/null 2>&1; then | |
| ORAS="$(command -v oras)" | |
| elif [ -x /usr/local/bin/oras ]; then | |
| ORAS=/usr/local/bin/oras | |
| else | |
| echo "ERROR: oras binary not found. Expected at /opt/bin/oras or in PATH (e.g., /usr/local/bin/oras)." >&2 | |
| exit 1 | |
| fi |
| FLATCAR_OS_NAME="FLATCAR" | ||
| AZURELINUX_OSGUARD_OS_VARIANT="OSGUARD" | ||
| KUBECTL=/opt/bin/kubectl | ||
| ORAS=/opt/bin/oras |
There was a problem hiding this comment.
isn't this path not present on older VHD, could this cse script run on older VHD ?
awesomenix
left a comment
There was a problem hiding this comment.
after discussing in teams this will break old VHD which is still using /usr/local/bin path
|
probably not needed. |
What this PR does / why we need it:
fixes oras path that was changed in #7125
Which issue(s) this PR fixes:
Fixes #