File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,12 @@ set -e -o pipefail
55source $( dirname $0 ) /version.sh
66
77RELEASE=" $( curl -sSL https://dl.k8s.io/release/stable.txt) "
8- pushd /usr/local/bin
9- sudo curl -L --remote-name-all https://dl.k8s.io/release/${RELEASE} /bin/linux/${ARCH:- amd64} /kubectl
10- sudo chmod +x kubectl
11- popd
8+ ARCH=" ${ARCH:- amd64} "
9+ TMP_DIR=" $( mktemp -d) "
10+ trap ' rm -rf "${TMP_DIR}"' EXIT
11+
12+ curl -fsSLo " ${TMP_DIR} /kubectl" " https://dl.k8s.io/release/${RELEASE} /bin/linux/${ARCH} /kubectl"
13+ curl -fsSLo " ${TMP_DIR} /kubectl.sha256" " https://dl.k8s.io/release/${RELEASE} /bin/linux/${ARCH} /kubectl.sha256"
14+ echo " $( cat " ${TMP_DIR} /kubectl.sha256" ) ${TMP_DIR} /kubectl" | sha256sum --check --status
15+
16+ sudo install -m 0755 " ${TMP_DIR} /kubectl" /usr/local/bin/kubectl
You can’t perform that action at this time.
0 commit comments