|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2025 The Kubernetes Authors All rights reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -e |
| 18 | +set -x |
| 19 | + |
| 20 | +OS="linux" |
| 21 | +ARCH="amd64" |
| 22 | +DRIVER="none" |
| 23 | +CONTAINER_RUNTIME="docker" |
| 24 | +EXTRA_START_ARGS="" |
| 25 | +EXTRA_TEST_ARGS="" |
| 26 | +JOB_NAME="None_Docker_Linux_X86-64" |
| 27 | +# marking all directories ('*') as trusted, since .git belongs to root, not minikube user |
| 28 | +git config --global --add safe.directory '*' |
| 29 | +COMMIT=$(git rev-parse HEAD) |
| 30 | +MINIKUBE_LOCATION=$COMMIT |
| 31 | + |
| 32 | + |
| 33 | +# conntrack is required for Kubernetes 1.18 and higher for none driver |
| 34 | +if ! conntrack --version &>/dev/null; then |
| 35 | + echo "WARNING: conntrack is not installed. will try to install." |
| 36 | + sudo apt-get update -qq |
| 37 | + sudo apt-get -qq -y install conntrack |
| 38 | +fi |
| 39 | + |
| 40 | +# socat is required for kubectl port forward which is used in some tests such as validateHelmTillerAddon |
| 41 | +if ! which socat &>/dev/null; then |
| 42 | + echo "WARNING: socat is not installed. will try to install." |
| 43 | + sudo apt-get update -qq |
| 44 | + sudo apt-get -qq -y install socat |
| 45 | +fi |
| 46 | + |
| 47 | +# cri-dockerd is required for Kubernetes v1.24+ with none driver |
| 48 | +CRI_DOCKERD_VERSION="0.4.1" |
| 49 | +if [[ $(cri-dockerd --version 2>&1) != *"$CRI_DOCKERD_VERSION"* ]]; then |
| 50 | + echo "WARNING: expected version of cri-dockerd is not installed. will try to install." |
| 51 | + sudo systemctl stop cri-docker.socket || true |
| 52 | + sudo systemctl stop cri-docker.service || true |
| 53 | + CRI_DOCKERD_COMMIT="55d6e1a1d6f2ee58949e13a0c66afe7d779ac942" |
| 54 | + CRI_DOCKERD_BASE_URL="https://storage.googleapis.com/kicbase-artifacts/cri-dockerd/${CRI_DOCKERD_COMMIT}" |
| 55 | + sudo curl -L "${CRI_DOCKERD_BASE_URL}/amd64/cri-dockerd" -o /usr/bin/cri-dockerd |
| 56 | + sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.socket" -o /usr/lib/systemd/system/cri-docker.socket |
| 57 | + sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.service" -o /usr/lib/systemd/system/cri-docker.service |
| 58 | + sudo chmod +x /usr/bin/cri-dockerd |
| 59 | + sudo systemctl daemon-reload |
| 60 | + sudo systemctl enable cri-docker.service |
| 61 | + sudo systemctl enable --now cri-docker.socket |
| 62 | +fi |
| 63 | + |
| 64 | +# crictl is required for Kubernetes v1.24+ with none driver |
| 65 | +CRICTL_VERSION="v1.34.0" |
| 66 | +if [[ $(crictl --version) != *"$CRICTL_VERSION"* ]]; then |
| 67 | + echo "WARNING: expected version of crictl is not installed. will try to install." |
| 68 | + curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz |
| 69 | + sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin |
| 70 | +fi |
| 71 | + |
| 72 | +# cni-plugins is required for Kubernetes v1.24+ with none driver |
| 73 | +./hack/jenkins/installers/check_install_cni_plugins.sh |
| 74 | + |
| 75 | + |
| 76 | +# by default, prow jobs run in root, so we must switch to a non-root user to run docker driver |
| 77 | +source ./hack/prow/common.sh |
0 commit comments