From 51defd6420035b92c27a71de22710cf31ad3b6c3 Mon Sep 17 00:00:00 2001 From: Rudraksh Pareek Date: Thu, 7 Mar 2024 12:15:44 +0530 Subject: [PATCH] use go-version-file and 1.22 in workflows Signed-off-by: Rudraksh Pareek --- .github/workflows/ci-latest-release.yml | 12 +++++------ .github/workflows/ci-operator-release.yaml | 8 ++++---- .github/workflows/ci-systemd-release.yml | 4 ++-- .github/workflows/ci-test-controllers.yml | 8 ++++---- .github/workflows/ci-test-ginkgo.yml | 4 ++-- .github/workflows/ci-test-go.yml | 24 +++++++++++----------- .github/workflows/ci-test-helm-charts.yml | 4 ++-- .github/workflows/ci-test-operator.yaml | 9 ++++---- .github/workflows/ci-test-systemd.yml | 4 ++-- .github/workflows/ci-test-ubi-image.yml | 4 ++-- Dockerfile | 2 +- pkg/KubeArmorController/Dockerfile | 4 ++-- pkg/KubeArmorOperator/Dockerfile | 4 ++-- 13 files changed, 46 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci-latest-release.yml b/.github/workflows/ci-latest-release.yml index 7c71081996..917d4adedb 100644 --- a/.github/workflows/ci-latest-release.yml +++ b/.github/workflows/ci-latest-release.yml @@ -53,9 +53,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Install the latest LLVM toolchain run: ./.github/workflows/install-llvm.sh @@ -217,11 +217,11 @@ jobs: runs-on: ubuntu-latest-16-cores timeout-minutes: 60 steps: - - uses: actions/setup-go@v3 - with: - go-version: "v1.22.1" - - uses: actions/checkout@v3 + + - uses: actions/setup-go@v5 + with: + go-version-file: 'KubeArmor/go.mod' - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/ci-operator-release.yaml b/.github/workflows/ci-operator-release.yaml index 87cf4fc0c5..0260e1be14 100644 --- a/.github/workflows/ci-operator-release.yaml +++ b/.github/workflows/ci-operator-release.yaml @@ -29,12 +29,12 @@ jobs: id-token: write timeout-minutes: 90 steps: - - uses: actions/setup-go@v3 - with: - go-version: "v1.22.1" - - uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + go-version-file: 'KubeArmor/go.mod' + - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/ci-systemd-release.yml b/.github/workflows/ci-systemd-release.yml index c78b5a1bc4..a98172912b 100644 --- a/.github/workflows/ci-systemd-release.yml +++ b/.github/workflows/ci-systemd-release.yml @@ -17,9 +17,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Install the latest LLVM toolchain run: ./.github/workflows/install-llvm.sh diff --git a/.github/workflows/ci-test-controllers.yml b/.github/workflows/ci-test-controllers.yml index 4ef2876b06..d02d1dad2a 100644 --- a/.github/workflows/ci-test-controllers.yml +++ b/.github/workflows/ci-test-controllers.yml @@ -19,14 +19,14 @@ jobs: env: RUNTIME: "containerd" steps: - - uses: actions/setup-go@v3 - with: - go-version: "v1.22.1" - - uses: actions/checkout@v3 with: submodules: true + - uses: actions/setup-go@v5 + with: + go-version-file: 'KubeArmor/go.mod' + - name: Check what paths were updated uses: dorny/paths-filter@v2 id: filter diff --git a/.github/workflows/ci-test-ginkgo.yml b/.github/workflows/ci-test-ginkgo.yml index 41aab9535f..0690d06959 100644 --- a/.github/workflows/ci-test-ginkgo.yml +++ b/.github/workflows/ci-test-ginkgo.yml @@ -39,9 +39,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Install the latest LLVM toolchain run: ./.github/workflows/install-llvm.sh diff --git a/.github/workflows/ci-test-go.yml b/.github/workflows/ci-test-go.yml index c5fb7a0243..cc146da391 100644 --- a/.github/workflows/ci-test-go.yml +++ b/.github/workflows/ci-test-go.yml @@ -27,9 +27,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Check gofmt run: make gofmt @@ -40,9 +40,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Run Revive Action on KubeArmor uses: morphy2k/revive-action@v2 @@ -54,9 +54,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Run Revive Action on KubeArmor tests uses: morphy2k/revive-action@v2 @@ -68,9 +68,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Run Gosec Security Scanner run: make gosec @@ -81,9 +81,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Run govulncheck run: make scan @@ -94,9 +94,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Run go test on the KubeArmor/KubeArmor directory run: go test ./... diff --git a/.github/workflows/ci-test-helm-charts.yml b/.github/workflows/ci-test-helm-charts.yml index be844fa902..252990b1e3 100644 --- a/.github/workflows/ci-test-helm-charts.yml +++ b/.github/workflows/ci-test-helm-charts.yml @@ -24,9 +24,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - uses: azure/setup-helm@v3 with: diff --git a/.github/workflows/ci-test-operator.yaml b/.github/workflows/ci-test-operator.yaml index 2f1e4e1a32..73089c9a1a 100644 --- a/.github/workflows/ci-test-operator.yaml +++ b/.github/workflows/ci-test-operator.yaml @@ -29,11 +29,12 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 20 steps: - - uses: actions/setup-go@v3 - with: - go-version: v1.22.1 - - uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + # working-directory only takes effect for "run" + go-version-file: 'KubeArmor/go.mod' + - name: Build kubearmor operator run: make docker-build TAG=latest diff --git a/.github/workflows/ci-test-systemd.yml b/.github/workflows/ci-test-systemd.yml index 5838904495..ebde18c77f 100644 --- a/.github/workflows/ci-test-systemd.yml +++ b/.github/workflows/ci-test-systemd.yml @@ -28,9 +28,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Install the latest LLVM toolchain run: ./.github/workflows/install-llvm.sh diff --git a/.github/workflows/ci-test-ubi-image.yml b/.github/workflows/ci-test-ubi-image.yml index b6432603b4..6dcc396e85 100644 --- a/.github/workflows/ci-test-ubi-image.yml +++ b/.github/workflows/ci-test-ubi-image.yml @@ -38,9 +38,9 @@ jobs: with: submodules: true - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: - go-version: "v1.22.1" + go-version-file: 'KubeArmor/go.mod' - name: Install the latest LLVM toolchain run: ./.github/workflows/install-llvm.sh diff --git a/Dockerfile b/Dockerfile index 364d97347f..e6b2d406d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ### Builder -FROM golang:1.22.1-alpine3.19 as builder +FROM golang:1.22-alpine3.19 as builder RUN apk --no-cache update RUN apk add --no-cache git clang llvm make gcc protobuf diff --git a/pkg/KubeArmorController/Dockerfile b/pkg/KubeArmorController/Dockerfile index 84e3f95041..392d680cf9 100644 --- a/pkg/KubeArmorController/Dockerfile +++ b/pkg/KubeArmorController/Dockerfile @@ -2,7 +2,7 @@ # Copyright 2022 Authors of KubeArmor # Build the manager binary -FROM golang:1.22.1 as builder +FROM golang:1.22 as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -44,4 +44,4 @@ COPY --from=builder --chown=default:default /workspace/manager . COPY LICENSE /licenses/license.txt USER 1000 -ENTRYPOINT ["/manager"] \ No newline at end of file +ENTRYPOINT ["/manager"] diff --git a/pkg/KubeArmorOperator/Dockerfile b/pkg/KubeArmorOperator/Dockerfile index 7afa58c638..d8d6f5ab16 100644 --- a/pkg/KubeArmorOperator/Dockerfile +++ b/pkg/KubeArmorOperator/Dockerfile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2022 Authors of KubeArmor -FROM docker.io/golang:1.22.1 as builder +FROM docker.io/golang:1.22 as builder ARG GOARCH ARG GOOS @@ -79,4 +79,4 @@ ARG OPERATOR_DIR=pkg/KubeArmorOperator COPY --from=builder /KubeArmor/$OPERATOR_DIR/snitch /snitch COPY LICENSE /licenses/license.txt -ENTRYPOINT ["/snitch"] \ No newline at end of file +ENTRYPOINT ["/snitch"]