github.com/k8snetworkplumbingwg/sriov-network-operator@v1.2.1-0.20240408194816-2d2e5a45d453/hack/get-e2e-kind-tools.sh (about)

     1  #!/usr/bin/env bash
     2  set -o errexit
     3  # ensure this file is sourced to add required components to PATH
     4  
     5  here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")"
     6  root="$(readlink --canonicalize "$here/..")"
     7  VERSION="v0.10.0"
     8  KIND_BINARY_URL="https://github.com/kubernetes-sigs/kind/releases/download/${VERSION}/kind-$(uname)-amd64"
     9  K8_STABLE_RELEASE_URL="https://storage.googleapis.com/kubernetes-release/release/stable.txt"
    10  JQ_RELEASE_URL="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64"
    11  
    12  if [ ! -d "${root}/bin" ]; then
    13        mkdir "${root}/bin"
    14  fi
    15  
    16  echo "retrieving kind"
    17  curl --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 60 -Lo "${root}/bin/kind" "${KIND_BINARY_URL}"
    18  chmod +x "${root}/bin/kind"
    19  
    20  echo "retrieving kubectl"
    21  curl --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 60 -Lo "${root}/bin/kubectl" "https://storage.googleapis.com/kubernetes-release/release/$(curl -s ${K8_STABLE_RELEASE_URL})/bin/linux/amd64/kubectl"
    22  chmod +x "${root}/bin/kubectl"
    23  
    24  echo "retrieving jq"
    25  curl --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 60 -Lo "${root}/bin/jq" "${JQ_RELEASE_URL}"
    26  chmod +x "${root}/bin/jq"
    27  export PATH="$PATH:$root/bin"