fix: filter apt list by CPU architecture to prevent cross-arch kubelet install failures#8639
Merged
Conversation
cameronmeissner
approved these changes
Jun 4, 2026
641dca5 to
3c2f7a2
Compare
cameronmeissner
approved these changes
Jun 4, 2026
…t install failures apt list --all-versions returns package entries for all architectures. Without filtering by the node CPU architecture, sort -V | tail -n 1 may select a package version that only exists for a different architecture (e.g., arm64-only u6 on an amd64 node), causing apt-get download to fail with 404. Add grep "$(getCPUArch)" to the pipeline to ensure only packages matching the current node architecture are considered when selecting the latest version. AB#38257849 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3c2f7a2 to
ed1ded1
Compare
Copilot stopped reviewing on behalf of
djsly due to an error
June 4, 2026 19:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where
installPkgWithAptGetin Ubuntu CSE picks arm64-only package versions on amd64 nodes, causing kubelet download failures (404).Root Cause
apt list --all-versionsreturns entries for all architectures:The existing grep pipeline only filtered by k8s version (e.g.,
1.34.0), sosort -V | tail -n 1could select a version that only exists for arm64 (u6). When an amd64 node then callsapt-get download kubelet=1.34.0-ubuntu24.04u6, it fails with 404.Fix
Added
grep "$(getCPUArch)"to the pipeline to filterapt listoutput to only the current node's architecture before selecting the latest version:getCPUArchis already defined incse_helpers.shand returns"amd64"or"arm64".Impact
Users reported kubelet download failures on Ubuntu 24.04 amd64 nodes for k8s 1.34.0 and 1.34.1:
kubelet_1.34.0-ubuntu24.04u6— arm64 only, no amd64kubelet_1.34.1-ubuntu24.04u5— arm64 only, no amd64Testing
GENERATE_TEST_DATA=true go test ./pkg/agent/...— all passAB#38257849