Skip to content

Commit 08ee794

Browse files
author
Paulo Gomes
committed
build: Skip cosign verification for CI
The libgit2 libraries are downloaded and verified before some of the make targets are executed. This assures the provenance of such files before using them and is very important specially for end users running such tests on their machines. Note that has been disabled specially due to recent issues we experienced at CI which can be seen in: fluxcd/source-controller#899 Signed-off-by: Paulo Gomes <[email protected]>
1 parent 8640fd1 commit 08ee794

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
# We should reenable go test -race for arm64 runners once the
5252
# current issue is resolved.
5353
GO_TEST_ARGS: ""
54+
SKIP_COSIGN_VERIFICATION: true
5455
- name: Verify
5556
run: make verify
5657

@@ -74,5 +75,7 @@ jobs:
7475
${{ runner.os }}-go-
7576
- name: Run tests
7677
run: make test
78+
env:
79+
SKIP_COSIGN_VERIFICATION: true
7780
- name: Verify
7881
run: make verify

.github/workflows/cifuzz.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ jobs:
2626
${{ runner.os }}-go-
2727
- name: Smoke test Fuzzers
2828
run: make fuzz-smoketest
29+
env:
30+
SKIP_COSIGN_VERIFICATION: true

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
1919
# Allows for defining additional Go test args, e.g. '-tags integration'.
2020
GO_TEST_ARGS ?= -race
2121

22+
# Defines whether cosign verification should be skipped.
23+
SKIP_COSIGN_VERIFICATION ?= false
24+
2225
# Directory with versioned, downloaded things
2326
CACHE := cache
2427

hack/install-libraries.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ IMG="${IMG:-}"
66
TAG="${TAG:-}"
77
IMG_TAG="${IMG}:${TAG}"
88
DOWNLOAD_URL="https://github.com/fluxcd/golang-with-libgit2/releases/download/${TAG}"
9+
SKIP_COSIGN_VERIFICATION="${SKIP_COSIGN_VERIFICATION:-false}"
910

1011
TMP_DIR=$(mktemp -d)
1112

@@ -48,9 +49,13 @@ cosign_verify(){
4849
assure_provenance() {
4950
[[ $# -eq 1 ]] || fatal 'assure_provenance needs exactly 1 arguments'
5051

51-
cosign_verify "${TMP_DIR}/checksums.txt.pem" \
52-
"${TMP_DIR}/checksums.txt.sig" \
53-
"${TMP_DIR}/checksums.txt"
52+
if "${SKIP_COSIGN_VERIFICATION}"; then
53+
echo 'Skipping cosign verification...'
54+
else
55+
cosign_verify "${TMP_DIR}/checksums.txt.pem" \
56+
"${TMP_DIR}/checksums.txt.sig" \
57+
"${TMP_DIR}/checksums.txt"
58+
fi
5459

5560
pushd "${TMP_DIR}" || exit
5661
if command -v sha256sum; then

0 commit comments

Comments
 (0)