From f0da15558adc1068041462312d188d1dc5357779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Wed, 13 Oct 2021 11:27:10 +0300 Subject: [PATCH 1/2] fix: safer way to install google/ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- .github/workflows/build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f13f0cc03f1..136a1636362 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,9 +39,7 @@ jobs: # run: sudo apt-get update && sudo apt-get install -yq libpcsclite-dev - name: install ko run: | - curl -L https://github.com/google/ko/releases/download/v${{ env.KO_VERSION }}/ko_${{ env.KO_VERSION }}_Linux_x86_64.tar.gz | tar xzf - ko && \ - chmod +x ./ko && sudo mv ko /usr/local/bin/ - + GOBIN=/usr/local/bin go install github.com/google/ko@v${{ .Env.KO_VERSION }} - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@master with: From a819fafd3c252d4feb1c9ff7684e83de1f01e677 Mon Sep 17 00:00:00 2001 From: Erkan Zileli Date: Wed, 13 Oct 2021 20:57:56 +0300 Subject: [PATCH 2/2] fix: update other ko installations as 'go install' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Erkan Zileli Co-authored-by: Batuhan Apaydın Co-authored-by: Furkan Türkal --- .github/workflows/kind-e2e-cosigned.yaml | 20 +++++++------------- .github/workflows/tests.yaml | 7 ++++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/kind-e2e-cosigned.yaml b/.github/workflows/kind-e2e-cosigned.yaml index ebbec7310cc..b50add91afd 100644 --- a/.github/workflows/kind-e2e-cosigned.yaml +++ b/.github/workflows/kind-e2e-cosigned.yaml @@ -43,6 +43,7 @@ jobs: INSECURE_REGISTRY_NAME: insecure-registry.notlocal INSECURE_REGISTRY_PORT: 5001 KO_DOCKER_REPO: registry.local:5000/cosigned + KO_VERSION: 0.9.3 steps: - name: Set up Go 1.16.x @@ -50,18 +51,11 @@ jobs: with: go-version: 1.16.x - - name: Install Dependencies - working-directory: ./ - run: | - echo '::group:: install ko' - curl -L https://github.com/google/ko/releases/download/v0.8.3/ko_0.8.3_Linux_x86_64.tar.gz | tar xzf - ko - chmod +x ./ko - sudo mv ko /usr/local/bin - echo '::endgroup::' + - name: Install ko + run: GOBIN=/usr/local/bin go install github.com/google/ko@v${{ .Env.KO_VERSION }} - echo '::group:: install yq' - go get github.com/mikefarah/yq/v4 - echo '::endgroup::' + - name: Install yq + uses: mikefarah/yq@master - name: Check out code onto GOPATH uses: actions/checkout@v2 @@ -177,12 +171,12 @@ jobs: # Wait for the webhook to come up and become Ready kubectl rollout status --timeout 5m --namespace cosign-system deployments/webhook - + - name: Run Insecure Registry Tests run: | go install github.com/google/go-containerregistry/cmd/crane ./test/e2e_test_insecure_registry.sh - + - name: Run Cosigned Tests run: | ./test/e2e_test_cosigned.sh diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 568bffe3f4f..c7588967113 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,9 @@ jobs: unit-tests: name: Run tests runs-on: ubuntu-latest + env: + KO_VERSION: 0.9.3 + steps: - uses: actions/checkout@v2 @@ -48,9 +51,7 @@ jobs: with: go-version: '1.17.x' - name: install ko - run: | - curl -L https://github.com/google/ko/releases/download/v0.8.3/ko_0.8.3_Linux_x86_64.tar.gz | tar xzf - ko && \ - chmod +x ./ko && sudo mv ko /usr/local/bin/ + run: GOBIN=/usr/local/bin go install github.com/google/ko@v${{ .Env.KO_VERSION }} - name: setup kind cluster run: | go install sigs.k8s.io/kind@v0.11.1