Skip to content

fix: pass explicit platform to krane export to fix arm64 skill loading#1487

Merged
EItanya merged 2 commits intomainfrom
iplay88keys/fix-skills-init-krane-platform
Mar 11, 2026
Merged

fix: pass explicit platform to krane export to fix arm64 skill loading#1487
EItanya merged 2 commits intomainfrom
iplay88keys/fix-skills-init-krane-platform

Conversation

@iplay88keys
Copy link
Contributor

Description

Fixes #1486

  • krane export defaults to linux/amd64 when resolving multi-platform OCI image indexes, regardless of the actual node architecture
  • On arm64 nodes, skills-init crashes with no child with platform linux/amd64 in index <image>, putting the pod in CrashLoopBackOff and preventing the agent from becoming Ready
  • Fix detects the node architecture at runtime via uname -m and passes it explicitly to krane via --platform

Testing

  • Deployed on arm64 kind cluster (Apple Silicon) — TestE2EInvokeSkillInAgent passes
  • All E2E tests pass

Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Copilot AI review requested due to automatic review settings March 11, 2026 20:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes arm64 agent startup failures by ensuring skills-init pulls the correct architecture variant from multi-platform OCI image indexes when running krane export.

Changes:

  • Detect node CPU architecture at runtime via uname -m (normalized to OCI arch strings).
  • Pass an explicit --platform linux/<arch> to krane export to avoid defaulting to linux/amd64.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

)"
echo "Exporting OCI image ${_image} into ${_dest}"
krane export{{ if $.InsecureOCI }} --insecure{{ end }} "$_image" '/tmp/oci-skill.tar'
_arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arch normalization uses a uname -m | sed ... pipeline with substring replacements. This can produce invalid platforms for values that contain those substrings (e.g. aarch64_be -> arm64_be) and makes it hard to fail fast on unsupported architectures. Consider switching to an explicit case mapping (x86_64/amd64 -> amd64, aarch64/arm64 -> arm64) and exiting with a clear error for anything else before invoking krane.

Suggested change
_arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
_uname="$(uname -m)"
case "$_uname" in
x86_64|amd64)
_arch="amd64"
;;
aarch64|arm64)
_arch="arm64"
;;
*)
echo "Unsupported architecture for OCI export: ${_uname}" >&2
exit 1
;;
esac

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 👍

Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
@EItanya EItanya merged commit 385d6cf into main Mar 11, 2026
23 checks passed
@EItanya EItanya deleted the iplay88keys/fix-skills-init-krane-platform branch March 11, 2026 22:31
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.

[BUG] skills-init krane defaults to linux/amd64 on arm64 nodes

3 participants