From 9702f92345feb447a35cbebe0ae22a9129e09776 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Mon, 7 Aug 2023 14:04:04 -0700 Subject: [PATCH] Fix for Kubeflag Integration test (#8154) * Use argument that doesn't require file * Use build-k3s workflow in cgroup * Bump timeout on integration tests Signed-off-by: Derek Nola --- .github/workflows/build-k3s.yaml | 2 +- .github/workflows/cgroup.yaml | 17 +++-------------- .github/workflows/integration.yaml | 4 ++-- Dockerfile.dapper | 2 +- scripts/package | 4 +++- tests/integration/kubeflags/kubeflags_test.go | 4 ++-- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-k3s.yaml b/.github/workflows/build-k3s.yaml index 95891af49c5..3a791a98cd8 100644 --- a/.github/workflows/build-k3s.yaml +++ b/.github/workflows/build-k3s.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v3 - name: Build K3s binary run: | - DOCKER_BUILDKIT=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make + DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make - name: bundle repo if: inputs.upload-repo == true diff --git a/.github/workflows/cgroup.yaml b/.github/workflows/cgroup.yaml index feeb92fdc33..db9ee8580ad 100644 --- a/.github/workflows/cgroup.yaml +++ b/.github/workflows/cgroup.yaml @@ -24,22 +24,11 @@ permissions: contents: read jobs: - prep: - name: "Prepare" - runs-on: ubuntu-20.04 - timeout-minutes: 40 - steps: - - name: "Checkout" - uses: actions/checkout@v3 - with: { fetch-depth: 1 } - - name: "Build" - run: DOCKER_BUILDKIT=1 SKIP_VALIDATE=1 make - - name: "Upload" - uses: actions/upload-artifact@v3 - with: { name: k3s, path: dist/artifacts/k3s } + build: + uses: ./.github/workflows/build-k3s.yaml test: name: "Conformance Test" - needs: prep + needs: build # nested virtualization is only available on macOS hosts runs-on: macos-12 timeout-minutes: 40 diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 559d0970a2d..7ca7cf3cbcf 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -34,7 +34,7 @@ jobs: needs: build name: Integration Tests runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Checkout uses: actions/checkout@v3 @@ -58,7 +58,7 @@ jobs: run: | chmod +x ./dist/artifacts/k3s mkdir -p $GOCOVERDIR - sudo -E env "PATH=$PATH" go test -v -timeout=30m ./tests/integration/... -run Integration + sudo -E env "PATH=$PATH" go test -v -timeout=45m ./tests/integration/... -run Integration - name: On Failure, Launch Debug Session if: ${{ failure() }} uses: mxschmitt/action-tmate@v3 diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 71c049c3be2..16b00e5a52c 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -50,7 +50,7 @@ ARG SELINUX=true ENV SELINUX $SELINUX ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/k3s-io/k3s/.cache -v trivy-cache:/root/.cache/trivy -ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_AIRGAP AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID GITHUB_TOKEN GOLANG GOCOVER DEBUG +ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_IMAGE SKIP_AIRGAP AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID GITHUB_TOKEN GOLANG GOCOVER DEBUG ENV DAPPER_SOURCE /go/src/github.com/k3s-io/k3s/ ENV DAPPER_OUTPUT ./bin ./dist ./build/out ./build/static ./pkg/static ./pkg/deploy diff --git a/scripts/package b/scripts/package index 51b8f417bb6..ca2123657e3 100755 --- a/scripts/package +++ b/scripts/package @@ -8,7 +8,9 @@ if [ ! -e ../bin/containerd ]; then fi ./package-cli -./package-image +if [ -z "$SKIP_IMAGE" ]; then + ./package-image +fi if [ -z "$SKIP_AIRGAP" ]; then ./package-airgap fi diff --git a/tests/integration/kubeflags/kubeflags_test.go b/tests/integration/kubeflags/kubeflags_test.go index 11cdb6f8e7e..784640b7906 100644 --- a/tests/integration/kubeflags/kubeflags_test.go +++ b/tests/integration/kubeflags/kubeflags_test.go @@ -14,7 +14,7 @@ var server *testutil.K3sServer var serverArgs = []string{"--cluster-init", "--kube-apiserver-arg", "advertise-port=1234", "--kube-controller-manager-arg", "allocate-node-cidrs=false", - "--kube-scheduler-arg", "authentication-kubeconfig=test", + "--kube-scheduler-arg", "allow-metric-labels=metric1,label1='v3'", "--kube-cloud-controller-manager-arg", "allocate-node-cidrs=false", "--kubelet-arg", "address=127.0.0.1", "--kube-proxy-arg", "cluster-cidr=127.0.0.1/16", @@ -52,7 +52,7 @@ var _ = Describe("create a new cluster with kube-* flags", Ordered, func() { }) It("should find kube-scheduler starting", func() { Eventually(func() error { - match, err := testutil.SearchK3sLog(server, "Running kube-scheduler --authentication-kubeconfig=test") + match, err := testutil.SearchK3sLog(server, "Running kube-scheduler --allow-metric-labels=metric1,label1='v3'") if err != nil { return err }