Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Cleanup Packer directory after VHD build (#3964)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon authored and jackfrancis committed Oct 5, 2018
1 parent 23d532b commit caa5c00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packer/vhd-image-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"inline": [
"sudo BUILD_NUMBER={{user `build_number`}} BUILD_ID={{user `build_id`}} COMMIT={{user `commit`}} /bin/bash -ux /home/packer/install-dependencies.sh",
"sudo /bin/bash -eux /home/packer/cleanup-vhd.sh",
"rm /home/packer/*.sh"
"rm -rf /home/packer"
]
}
]
Expand Down
1 change: 1 addition & 0 deletions parts/k8s/kubernetescustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fi
if [ -f /var/log/azure/golden-image-install.complete ]; then
echo "detected golden image pre-install"
FULL_INSTALL_REQUIRED=false
rm -rf /home/packer
else
FULL_INSTALL_REQUIRED=true
fi
Expand Down
9 changes: 5 additions & 4 deletions parts/k8s/kubernetesinstalls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ function pullHyperkube() {
path=$(find /home/rootfs-${KUBERNETES_VERSION} -name "hyperkube")

if [[ $OS == $COREOS_OS_NAME ]]; then
cp "$path" "/opt/kubelet"
cp "$path" "/opt/kubectl"
mv "$path" "/opt/kubelet"
mv "$path" "/opt/kubectl"
chmod a+x /opt/kubelet /opt/kubectl
else
cp "$path" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}"
cp "$path" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}"
mv "$path" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}"
mv "$path" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}"
fi
}

Expand All @@ -213,6 +213,7 @@ function extractHyperkube() {
mv "/usr/local/bin/kubectl-${KUBERNETES_VERSION}" "/usr/local/bin/kubectl"
chmod a+x /usr/local/bin/kubelet /usr/local/bin/kubectl
rm -rf /usr/local/bin/kubelet-* /usr/local/bin/kubectl-*
rm -rf /home/rootfs-*
}

function pullContainerImage() {
Expand Down

0 comments on commit caa5c00

Please sign in to comment.