From 6dc330539b87871baa6cedceb26e3820c64263ea Mon Sep 17 00:00:00 2001 From: yiraeChristineKim Date: Tue, 25 Aug 2026 11:13:55 -0400 Subject: [PATCH] fix(stolostron/mtv-integrations): set GOCACHE for sonar jobs to avoid stale build cache The Go linker in prow's src container was failing with "cannot reopen /go/pkg/cache/...(_x001.o): no such file or directory" when building the controllers package test binary. This caused the controllers package to be skipped entirely, resulting in 0% new coverage for PRs touching controllers/cacert.go. Root cause: the Go build cache baked into the Docker image (at /go/pkg/cache) contains stale linker artifacts. When go test tries to link the test binary, it finds cache index entries pointing to object files that don't exist, causing exit code 2 before coverage.out is written. Fix: explicitly set GOCACHE=/tmp/.cache/go-build so go test ignores the Docker-layer build cache and compiles from source in a clean temp directory. Co-authored-by: Cursor --- .../mtv-integrations/stolostron-mtv-integrations-main.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-operator/config/stolostron/mtv-integrations/stolostron-mtv-integrations-main.yaml b/ci-operator/config/stolostron/mtv-integrations/stolostron-mtv-integrations-main.yaml index bbd285f17266c..7860d849409e5 100644 --- a/ci-operator/config/stolostron/mtv-integrations/stolostron-mtv-integrations-main.yaml +++ b/ci-operator/config/stolostron/mtv-integrations/stolostron-mtv-integrations-main.yaml @@ -31,6 +31,7 @@ tests: export SELF="make -f /opt/build-harness/Makefile.prow" export HOME="/tmp" export XDG_CACHE_HOME="/tmp/.cache" + export GOCACHE="/tmp/.cache/go-build" export JAVA_TOOL_OPTIONS="-Duser.home=/tmp" make -f /opt/build-harness/Makefile.prow sonar/go/prow container: @@ -44,6 +45,7 @@ tests: export SELF="make -f /opt/build-harness/Makefile.prow" export HOME="/tmp" export XDG_CACHE_HOME="/tmp/.cache" + export GOCACHE="/tmp/.cache/go-build" export JAVA_TOOL_OPTIONS="-Duser.home=/tmp" make -f /opt/build-harness/Makefile.prow sonar/go/prow container: