From f0c5e9ad8e4ccd88e9825fb3a78610043b5f711a Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Thu, 12 Sep 2024 10:20:06 +0000 Subject: [PATCH] some fixes Signed-off-by: zhangzujian --- .github/workflows/build-x86-image.yaml | 121 ++++++++++++------------- dist/images/Dockerfile.base | 2 +- 2 files changed, 61 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index 760cc566f32f..872d513867ee 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -21,10 +21,9 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: '' KIND_VERSION: v0.24.0 GOLANGCI_LINT_VERSION: 'v1.61.0' - HELM_VERSION: v3.15.4 + HELM_VERSION: v3.16.0 SUBMARINER_VERSION: '0.18.0' jobs: @@ -152,8 +151,8 @@ jobs: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true cache: false @@ -161,7 +160,7 @@ jobs: - name: Setup environment variables run: | echo "TAG=$(cat VERSION)" >> "$GITHUB_ENV" - echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache@v4 @@ -169,8 +168,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-x86-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go-${{ env.GO_VERSION }}-x86- - name: Unit test run: | @@ -295,14 +294,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Lookup Go cache id: lookup-go-cache @@ -311,8 +310,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- lookup-only: true - uses: jlumbroso/free-disk-space@v1.3.1 @@ -333,8 +332,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install ginkgo if: steps.lookup-go-cache.outputs.cache-hit != 'true' @@ -354,8 +353,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true cache: false @@ -436,14 +435,14 @@ jobs: sudo systemctl restart docker - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -451,8 +450,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -632,14 +631,14 @@ jobs: sudo systemctl restart docker - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -647,8 +646,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -985,14 +984,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -1000,8 +999,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -1178,14 +1177,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -1193,8 +1192,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -1335,14 +1334,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -1350,8 +1349,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -1680,14 +1679,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -1695,8 +1694,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -1823,14 +1822,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -1838,8 +1837,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -2019,14 +2018,14 @@ jobs: sudo systemctl restart docker - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -2034,8 +2033,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -2174,14 +2173,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -2189,8 +2188,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -2388,14 +2387,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -2403,8 +2402,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -2531,14 +2530,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -2546,8 +2545,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 @@ -2674,14 +2673,14 @@ jobs: fi - uses: actions/setup-go@v5 + id: setup-go with: - go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true cache: false - name: Export Go full version - run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" + run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" - name: Go cache uses: actions/cache/restore@v4 @@ -2689,8 +2688,8 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} - restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- + key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} + restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- - name: Install kind uses: helm/kind-action@v1.10.0 diff --git a/dist/images/Dockerfile.base b/dist/images/Dockerfile.base index 8c90e4aca9d6..c2b2ce430a44 100644 --- a/dist/images/Dockerfile.base +++ b/dist/images/Dockerfile.base @@ -149,7 +149,7 @@ RUN curl -sSf -L --retry 3 -o /usr/local/bin/bfdd-control https://github.com/bob setcap CAP_NET_BIND_SERVICE+eip $(readlink -f $(which bfdd-beacon)) RUN --mount=type=bind,target=/godeps,from=go-deps,source=/godeps /godeps \ - cd /godeps/loopback /godeps/portmap /godeps/macvlan ./ && \ + cp /godeps/loopback /godeps/portmap /godeps/macvlan ./ && \ cp /godeps/kubectl /godeps/gobgp /usr/bin/ ARG DEBUG=false