Skip to content

Commit 452494e

Browse files
djslyCopilot
andauthored
fix: filter apt list by CPU architecture to prevent cross-arch kubelet install failures (#8639)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 20d11e4 commit 452494e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ installPkgWithAptGet() {
376376

377377
# update pmc repo to get latest versions
378378
updatePMCRepository "${packageVersion}"
379-
# query all package versions and get the latest version for matching k8s version
380-
fullPackageVersion=$(apt list "${packageName}" --all-versions | grep "${packageVersion}" | awk '{print $2}' | sort -V | tail -n 1)
379+
# query all package versions and get the latest version for matching k8s version and cpu architecture
380+
fullPackageVersion=$(apt list "${packageName}" --all-versions | grep "${packageVersion}" | grep "$(getCPUArch)" | awk '{print $2}' | sort -V | tail -n 1)
381381
if [ -z "${fullPackageVersion}" ]; then
382382
echo "Failed to find valid ${packageName} version for ${packageVersion}"
383383
return 1

0 commit comments

Comments
 (0)