Skip to content

fix: fix delete cached kube binaries#8533

Merged
lilypan26 merged 3 commits into
mainfrom
lily/fix-kube-binary-cleanup
May 18, 2026
Merged

fix: fix delete cached kube binaries#8533
lilypan26 merged 3 commits into
mainfrom
lily/fix-kube-binary-cleanup

Conversation

@lilypan26
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Copy link
Copy Markdown
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

This PR fixes cleanup of cached kube binaries during Linux node provisioning by allowing the shell glob to expand when removing stale /opt/bin/<package>-* files after a fallback binary install.

Changes:

  • Updates fallbackToKubeBinaryInstall in cse_helpers.sh so cached kube binary cleanup matches versioned files correctly.

chown root:root "${targetPath}"
chmod 0755 "${targetPath}"
rm -rf "/opt/bin/${packageName}-*" &
rm -rf /opt/bin/"${packageName}"-* &
@Devinwong
Copy link
Copy Markdown
Collaborator

Could you also take care of this issue?
Cache miss: if RP requests a version that isn't pre-baked, fallbackToKubeBinaryInstall returns 1 and we fall through to apt-get install from PMC — no cleanup of the other cached /opt/bin/kubelet-* versions runs in that branch.

Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh
Copilot AI review requested due to automatic review settings May 18, 2026 22:41
Copy link
Copy Markdown
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


rm -rf "${downloadDir}"
# Clean up stale cached binaries that were not used
rm -f /opt/bin/"${packageName}"-* &
logs_to_events "AKS.CSE.install${packageName}.extractBinaryFromRPM" "extractBinaryFromRPM ${rpmFile} ${packageName} ${targetPath}" || exit "$ERR_APT_INSTALL_TIMEOUT"
rm -rf "${downloadDir}"
# Clean up stale cached binaries that were not used
rm -f /opt/bin/"${packageName}"-* &

# All tools installed successfully
rm -rf "${download_root}"
rm -f /opt/bin/"${tool_name}"-* &
chown root:root "${targetPath}"
chmod 0755 "${targetPath}"
rm -rf "/opt/bin/${packageName}-*" &
rm -rf /opt/bin/"${packageName}"-* &
rpm2cpio "${rpmFile}" | cpio -i --to-stdout "./usr/bin/${packageName}" "./usr/local/bin/${packageName}" | install -m0755 /dev/stdin "${targetPath}"
rm -rf "${downloadDir}"
# Clean up stale cached binaries that were not used
rm -f /opt/bin/"${packageName}"-* &
@lilypan26 lilypan26 merged commit 0fd644c into main May 18, 2026
24 of 36 checks passed
@lilypan26 lilypan26 deleted the lily/fix-kube-binary-cleanup branch May 18, 2026 23:04
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.

4 participants