#!/bin/bash # Copyright 2018 by the contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -o verbose set -o errexit set -o nounset set -o pipefail test -n "{{BaseBinaryUrl}}" url_base="{{BaseBinaryUrl}}" for binary in kubelet kubeadm kubectl; do url=${url_base%/}/$binary echo "Attempting to download: $url" if /usr/bin/curl -Lf -o /tmp/$binary "$url"; then md5=($(/usr/bin/md5sum /tmp/$binary)) echo "Installing override binary $binary with md5sum: $md5" /usr/bin/install -o root -g root -m 0755 /tmp/$binary /usr/bin/$binary if [ "$binary" == "kubelet" ]; then /bin/systemctl daemon-reload /bin/systemctl restart kubelet fi fi done;