Skip to content

Commit

Permalink
Add GOWORK env variable when go vet is run
Browse files Browse the repository at this point in the history
The cinder-operator patch [1] introduces the 'go.work' file within the
repository with the goal of automating the way we deal with multi module
dependencies.
However, the side effect of having a versioned 'go.work' in the repo is
the failure of this script because GOWORK is automatically set to "on".
This patch fixes the CI run on the cinder-operator PR [1], introducing
a GOWORK variable (which is set to off by default) to make sure we can
successfully run this check regardless of the Makefile approach.

[1] openstack-k8s-operators/cinder-operator#79

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Nov 29, 2022
1 parent 9471567 commit 82ae69c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test-runner/govet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -ex

GOWORK=${GOWORK:-'off'}
BASE_DIR="$(dirname $0)"
cd "${BASE_DIR}/../.."

Expand All @@ -10,5 +11,6 @@ if [ -n "$1" ]; then
fi

pushd ${MODULE_DIR}
GOWORK=$GOWORK
go vet -mod=mod ./...
popd

0 comments on commit 82ae69c

Please sign in to comment.