Skip to content

Commit b2daa3e

Browse files
committed
tests/fuzz: update build config
Ensure we only download github.com/AdaLogics/go-fuzz-headers once; clearify use `go.mod`. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 2142eb3 commit b2daa3e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/fuzz/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Used to exclude it from Go mod in repository root.
2+
// Replaced by oss_fuzz_build.sh.
13
module github.com/fluxcd/image-automation-controller/tests/fuzz
24

35
go 1.17

tests/fuzz/oss_fuzz_build.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ export PKG_CONFIG_PATH="${TARGET_DIR}/lib/pkgconfig:${TARGET_DIR}/lib64/pkgconfi
5454
export CGO_CFLAGS="-I${TARGET_DIR}/include -I${TARGET_DIR}/include/openssl"
5555
export CGO_LDFLAGS="$(pkg-config --libs --static --cflags libssh2 openssl libgit2)"
5656

57-
go get -d github.com/AdaLogics/go-fuzz-headers
58-
5957
pushd "tests/fuzz"
6058

6159
# Setup files to be embedded into controllers_fuzzer.go's testFiles variable.
@@ -79,6 +77,8 @@ SOURCE_VER=$(go list -m github.com/fluxcd/source-controller/api | awk '{print $2
7977
REFLECTOR_VER=$(go list -m github.com/fluxcd/image-reflector-controller/api | awk '{print $2}')
8078

8179
go mod download
80+
go get -d github.com/fluxcd/image-automation-controller
81+
go get -d github.com/AdaLogics/go-fuzz-headers
8282

8383
if [ -d "../../controllers/testdata/crds" ]; then
8484
cp ../../controllers/testdata/crds/*.yaml testdata/crds
@@ -89,9 +89,6 @@ else
8989
curl -s --fail https://raw.githubusercontent.com/fluxcd/image-reflector-controller/${REFLECTOR_VER}/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml -o testdata/crds/imagepolicies.yaml
9090
fi
9191

92-
go get -d github.com/AdaLogics/go-fuzz-headers
93-
go get -d github.com/fluxcd/image-automation-controller
94-
9592
# Using compile_go_fuzzer to compile fails when statically linking libgit2 dependencies
9693
# via CFLAGS/CXXFLAGS.
9794
function go_compile(){

0 commit comments

Comments
 (0)