From 03fcb34abe806a68675b562a46424b7493ce60b7 Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Thu, 15 Feb 2024 18:21:43 +0900 Subject: [PATCH] Update kind e2e --- .github/workflows/kind-e2e.yml | 11 +---- e2e/get_tools.sh | 2 +- e2e/setup_cluster.sh | 45 +++------------------ e2e/teardown.sh | 3 -- e2e/templates/multus-daemonset-thick.yml.j2 | 1 - 5 files changed, 7 insertions(+), 55 deletions(-) diff --git a/.github/workflows/kind-e2e.yml b/.github/workflows/kind-e2e.yml index 43beb206e..72539edda 100644 --- a/.github/workflows/kind-e2e.yml +++ b/.github/workflows/kind-e2e.yml @@ -48,9 +48,6 @@ jobs: sudo apt-get install -y j2cli echo $(j2 --version) - - name: Setup registry - run: docker run -d --restart=always -p "5000:5000" --name "kind-registry" registry:2 - - name: Build latest-amd64 uses: docker/build-push-action@v5 with: @@ -60,10 +57,6 @@ jobs: file: ${{ matrix.docker-file }} platforms: linux/amd64 - # docker buildx push is failed due to https://github.com/docker/buildx/issues/94 - - name: Push to local registry - run: docker push localhost:5000/multus:e2e - - name: Get kind/kubectl/koko working-directory: ./e2e run: ./get_tools.sh @@ -74,7 +67,7 @@ jobs: - name: Setup cluster working-directory: ./e2e - run: MULTUS_MANIFEST=${{ matrix.multus-manifest }} ./setup_cluster.sh + run: MULTUS_MANIFEST=${{ matrix.multus-manifest }} MULTUS_DOCKERFILE=none ./setup_cluster.sh - name: Test simple pod working-directory: ./e2e @@ -108,5 +101,3 @@ jobs: - name: cleanup cluster and registry run: | kind delete cluster - docker kill kind-registry - docker rm kind-registry diff --git a/e2e/get_tools.sh b/e2e/get_tools.sh index 3e4aef0b6..fbc5b4057 100755 --- a/e2e/get_tools.sh +++ b/e2e/get_tools.sh @@ -5,7 +5,7 @@ if [ ! -d bin ]; then mkdir bin fi -curl -Lo ./bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.20.0/kind-$(uname)-amd64" +curl -Lo ./bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.22.0/kind-$(uname)-amd64" chmod +x ./bin/kind curl -Lo ./bin/kubectl https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl chmod +x ./bin/kubectl diff --git a/e2e/setup_cluster.sh b/e2e/setup_cluster.sh index 3a4ab806d..40286628a 100755 --- a/e2e/setup_cluster.sh +++ b/e2e/setup_cluster.sh @@ -14,32 +14,17 @@ MULTUS_MANIFEST="${MULTUS_MANIFEST:-multus-daemonset-thick.yml}" # define the dockerfile to build multus. # Acceptable values are `Dockerfile`. `Dockerfile.thick`. # Defaults to `Dockerfile.thick`. -MULTUS_DOCKERFILE="${MULTUS_MANIFEST:-Dockerfile.thick}" +MULTUS_DOCKERFILE="${MULTUS_DOCKERFILE:-Dockerfile.thick}" kind_network='kind' -reg_name='kind-registry' -reg_port='5000' -running="$($OCI_BIN inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" -if [ "${running}" != 'true' ]; then - # run registry and push the multus image - $OCI_BIN run -d --restart=always -p "${reg_port}:5000" --name "${reg_name}" registry:2 - $OCI_BIN build -t localhost:5000/multus:e2e -f ../images/${MULTUS_DOCKERFILE} .. - $OCI_BIN push localhost:5000/multus:e2e +if [ "${MULTUS_DOCKERFILE}" != "none" ]; then + $OCI_BIN build -t localhost:5000/multus:e2e -f ../images/${MULTUS_DOCKERFILE} .. fi -reg_host="${reg_name}" -if [ "${kind_network}" = "bridge" ]; then - reg_host="$($OCI_BIN inspect -f '{{.NetworkSettings.IPAddress}}' "${reg_name}")" -fi -echo "Registry Host: ${reg_host}" # deploy cluster with kind cat <