File tree Expand file tree Collapse file tree
parts/linux/cloud-init/artifacts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ installRPMPackageFromFile() {
5454 # This assumes that the binary will either be in /usr/bin or /usr/local/bin, but not both.
5555 rpm2cpio " ${rpmFile} " | cpio -i --to-stdout " ./usr/bin/${packageName} " " ./usr/local/bin/${packageName} " | install -m0755 /dev/stdin " ${targetPath} "
5656 rm -rf " ${downloadDir} "
57+ # Clean up stale cached binaries that were not used
58+ rm -f /opt/bin/" ${packageName} " -* &
5759}
5860
5961downloadPkgFromVersion () {
Original file line number Diff line number Diff line change @@ -1085,7 +1085,7 @@ fallbackToKubeBinaryInstall() {
10851085 mv " /opt/bin/${packageName} -${packageVersion} " " ${targetPath} "
10861086 chown root:root " ${targetPath} "
10871087 chmod 0755 " ${targetPath} "
1088- rm -rf " /opt/bin/${packageName} -* " &
1088+ rm -rf /opt/bin/" ${packageName} " - * &
10891089 return 0
10901090 else
10911091 echo " No binary fallback found for ${packageName} version ${packageVersion} "
Original file line number Diff line number Diff line change @@ -576,6 +576,7 @@ installToolFromBootstrapProfileRegistry() {
576576
577577 # All tools installed successfully
578578 rm -rf " ${download_root} "
579+ rm -f /opt/bin/" ${tool_name} " -* &
579580 return 0
580581}
581582
Original file line number Diff line number Diff line change @@ -518,6 +518,8 @@ installRPMPackageFromFile() {
518518 rpmFile=" ${downloadDir} /${rpmFile} "
519519 logs_to_events " AKS.CSE.install${packageName} .extractBinaryFromRPM" " extractBinaryFromRPM ${rpmFile} ${packageName} ${targetPath} " || exit " $ERR_APT_INSTALL_TIMEOUT "
520520 rm -rf " ${downloadDir} "
521+ # Clean up stale cached binaries that were not used
522+ rm -f /opt/bin/" ${packageName} " -* &
521523}
522524
523525installPackageFromCache () {
@@ -546,6 +548,7 @@ installPackageFromCache() {
546548 rpmFile=" ${downloadDir} /${rpmFile} "
547549 logs_to_events " AKS.CSE.install${packageName} .extractBinaryFromRPM" " extractBinaryFromRPM ${rpmFile} ${packageName} ${targetPath} " || exit " $ERR_APT_INSTALL_TIMEOUT "
548550 rm -rf " ${downloadDir} "
551+ rm -f /opt/bin/" ${packageName} " -* &
549552}
550553
551554downloadPkgFromVersion () {
Original file line number Diff line number Diff line change @@ -396,6 +396,8 @@ installPkgWithAptGet() {
396396 logs_to_events " AKS.CSE.install${packageName} .extractDebBinaryFromFile" " extractDebBinaryFromFile ${debFile} ${packageName} ${targetPath} " || exit " $ERR_APT_INSTALL_TIMEOUT "
397397
398398 rm -rf " ${downloadDir} "
399+ # Clean up stale cached binaries that were not used
400+ rm -f /opt/bin/" ${packageName} " -* &
399401}
400402
401403installPackageFromCache () {
@@ -425,6 +427,7 @@ installPackageFromCache() {
425427 logs_to_events " AKS.CSE.install${packageName} .extractDebBinaryFromFile" " extractDebBinaryFromFile ${debFile} ${packageName} ${targetPath} " || exit " $ERR_APT_INSTALL_TIMEOUT "
426428
427429 rm -rf " ${downloadDir} "
430+ rm -f /opt/bin/" ${packageName} " -* &
428431}
429432
430433downloadPkgFromVersion () {
You can’t perform that action at this time.
0 commit comments