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

fix: extract kubelet and kubectl binaries from hyperkube's binary folder when possible #2298

Merged
merged 2 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.