Skip to content

Commit 5ea4922

Browse files
author
Paulo Gomes
authored
Merge pull request #921 from pjbgf/bump-libgit2-image
Bump libgit2 image and disable cosign verification for CI
2 parents ac80849 + 6c06f4e commit 5ea4922

File tree

7 files changed

+28
-11
lines changed

7 files changed

+28
-11
lines changed

.github/workflows/cifuzz.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
${{ runner.os }}-go
3434
- name: Smoke test Fuzzers
3535
run: make fuzz-smoketest
36+
env:
37+
SKIP_COSIGN_VERIFICATION: true

.github/workflows/e2e.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
uses: fluxcd/pkg/actions/helm@main
4848
- name: Run E2E tests
4949
env:
50+
SKIP_COSIGN_VERIFICATION: true
5051
CREATE_CLUSTER: false
5152
run: make e2e
5253

@@ -76,6 +77,7 @@ jobs:
7677
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
7778
- name: Run e2e tests
7879
env:
80+
SKIP_COSIGN_VERIFICATION: true
7981
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
8082
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
8183
CREATE_CLUSTER: false

.github/workflows/tests.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
${{ runner.os }}-go-
3535
- name: Run tests
3636
env:
37+
SKIP_COSIGN_VERIFICATION: true
3738
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
3839
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
3940
run: make test
@@ -51,6 +52,8 @@ jobs:
5152
go-version: 1.19.x
5253
- name: Run tests
5354
env:
55+
SKIP_COSIGN_VERIFICATION: true
56+
5457
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
5558
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
5659

@@ -87,3 +90,5 @@ jobs:
8790
${{ runner.os }}-go-
8891
- name: Run tests
8992
run: make test
93+
env:
94+
SKIP_COSIGN_VERIFICATION: true

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.19
33
ARG XX_VERSION=1.1.2
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2-only
6-
ARG LIBGIT2_TAG=v0.2.0
6+
ARG LIBGIT2_TAG=v0.3.0
77

88
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} AS libgit2-libs
99

@@ -64,11 +64,11 @@ ENV CGO_ENABLED=1
6464

6565
# Instead of using xx-go, (cross) compile with vanilla go leveraging musl tool chain.
6666
RUN export PKG_CONFIG_PATH="/usr/local/$(xx-info triple)/lib/pkgconfig" && \
67-
export CGO_LDFLAGS="$(pkg-config --static --libs --cflags libgit2) -static -fuse-ld=lld" && \
68-
xx-go build \
69-
-ldflags "-s -w" \
70-
-tags 'netgo,osusergo,static_build' \
71-
-o /source-controller -trimpath main.go;
67+
export CGO_LDFLAGS="$(pkg-config --static --libs --cflags libgit2) -static -fuse-ld=lld" && \
68+
xx-go build \
69+
-ldflags "-s -w" \
70+
-tags 'netgo,osusergo,static_build' \
71+
-o /source-controller -trimpath main.go;
7272

7373
# Ensure that the binary was cross-compiled correctly to the target platform.
7474
RUN xx-verify --static /source-controller

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ TAG ?= latest
44

55
# Base image used to build the Go binary
66
LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2-only
7-
LIBGIT2_TAG ?= v0.2.0
7+
LIBGIT2_TAG ?= v0.3.0
88

99
# Allows for defining additional Go test args, e.g. '-tags integration'.
1010
GO_TEST_ARGS ?= -race
1111

1212
# Allows for filtering tests based on the specified prefix
1313
GO_TEST_PREFIX ?=
1414

15+
# Defines whether cosign verification should be skipped.
16+
SKIP_COSIGN_VERIFICATION ?= false
17+
1518
# Allows for defining additional Docker buildx arguments,
1619
# e.g. '--push'.
1720
BUILD_ARGS ?=

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

tests/fuzz/oss_fuzz_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
set -euxo pipefail
1818

19-
LIBGIT2_TAG="${LIBGIT2_TAG:-v0.2.0}"
19+
LIBGIT2_TAG="${LIBGIT2_TAG:-v0.3.0}"
2020
GOPATH="${GOPATH:-/root/go}"
2121
GO_SRC="${GOPATH}/src"
2222
PROJECT_PATH="github.com/fluxcd/source-controller"

0 commit comments

Comments
 (0)