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

Commit

Permalink
fix: extract kubelet and kubectl binaries from hyperkube's binary fol…
Browse files Browse the repository at this point in the history
…der when possible (#2298)

* fix: extract kubelet and kubectl directly from hyperkube's binary folder

* Fix generated files
  • Loading branch information
Ernest Wong authored and acs-bot committed Nov 12, 2019
1 parent 5814afc commit 975af62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion parts/k8s/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ extractHyperkube() {
pullContainerImage $CLI_TOOL ${HYPERKUBE_URL}
if [[ "$CLI_TOOL" == "docker" ]]; then
mkdir -p "$path"
docker run --rm -v $path:$path ${HYPERKUBE_URL} /bin/bash -c "cp /hyperkube $path"
# Check if we can extract kubelet and kubectl directly from hyperkube's binary folder
if docker run --rm --entrypoint "" -v $path:$path ${HYPERKUBE_URL} /bin/bash -c "cp /usr/local/bin/{kubelet,kubectl} $path"; then
mv "$path/kubelet" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}"
mv "$path/kubectl" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}"
return
else
docker run --rm -v $path:$path ${HYPERKUBE_URL} /bin/bash -c "cp /hyperkube $path"
fi
else
img unpack -o "$path" ${HYPERKUBE_URL}
fi
Expand Down
9 changes: 8 additions & 1 deletion pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 975af62

Please sign in to comment.