Skip to content

Commit 7c7aac0

Browse files
committed
chore: address comments
1 parent 1af830f commit 7c7aac0

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

.pipelines/templates/run-unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ stages:
2222
{ { { {
2323
sudo -E env "PATH=$PATH" make test-all;
2424
echo $? >&3;
25-
} | tee >(go tool go-junit-report > report.xml) >&4;
25+
} | tee >(go tool -modfile=tools.go.mod go-junit-report > report.xml) >&4;
2626
} 3>&1;
2727
} | { read xs; exit $xs; }
2828
} 4>&1

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ lint-all: ## Lint the current branch in entirety.
882882

883883
FMT_PKG ?= cni cns npm
884884

885-
fmt: $(GOFUMPT) ## run gofumpt on $FMT_PKG (default "cni cns npm").
886-
$(GOFUMPT) -s -w $(FMT_PKG)
885+
fmt: ## run gofumpt on $FMT_PKG (default "cni cns npm").
886+
go tool -modfile=$(TOOLS_GO_MOD) gofumpt -s -w $(FMT_PKG)
887887

888888

889889
workspace: ## Set up the Go workspace.
@@ -965,7 +965,7 @@ dockerfiles: renderkit ## Render all Dockerfile templates with current state of
965965
@make -f build/images.mk render PATH=cns
966966
@make -f build/images.mk render PATH=cni
967967

968-
regenerate-crd: controller-gen ## Regenerate CRDs
968+
regenerate-crd: ## Regenerate CRDs
969969
for makefile in $$(find ./crd/ -name "Makefile" -type f -printf '%h\n'); do \
970970
echo "Running make in $$makefile"; \
971971
make -C $$makefile; \
@@ -989,13 +989,11 @@ setup: install-hooks gitconfig ## performs common required repo setup
989989

990990
##@ Tools
991991

992-
tools: renderkit controller-gen
992+
tools: renderkit
993993

994994
renderkit: ## Install renderkit for rendering Dockerfile templates
995995
@go install -modfile=$(TOOLS_GO_MOD) github.com/orellazri/renderkit
996996

997-
controller-gen: ## Install renderkit for rendering Dockerfile templates
998-
@go install -modfile=$(TOOLS_GO_MOD) -mod=readonly sigs.k8s.io/controller-tools/cmd/controller-gen
999997

1000998
##@ Help
1001999

cns/multitenantcontroller/mockclients/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
REPO_ROOT = $(shell git rev-parse --show-toplevel)
2-
MOCKGEN = go tool mockgen
2+
MOCKGEN = go tool -modfile=$(REPO_ROOT)/tools.go.mod mockgen
33

44
generate: ## Generate mock clients
55
@go mod vendor

npm/pkg/dataplane/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
REPO_ROOT = $(shell git rev-parse --show-toplevel)
2-
MOCKGEN = go tool mockgen
2+
MOCKGEN = go tool -modfile=$(REPO_ROOT)/tools.go.mod mockgen
33

44
.PHONY: generate
55

platform/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
REPO_ROOT = $(shell git rev-parse --show-toplevel)
2-
MOCKGEN = go tool mockgen
2+
MOCKGEN = go tool -modfile=$(REPO_ROOT)/tools.go.mod mockgen
33

44
.PHONY: generate
55

scripts/install-protoc.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PROTOBUFF_VERSION=3.19.1
44
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
55
PROTOC_ZIP_NAME=protoc-${PROTOBUFF_VERSION}-linux-x86_64.zip
66
PROTOC_INSTALL_PATH=$HOME/.local
7+
REPO_ROOT=$(git rev-parse --show-toplevel)
78

89
# install unzip on linux if not installed
910
if [[ "$OSTYPE" == "linux-gnu" ]]; then
@@ -18,7 +19,7 @@ if [ ! -f ${PROTOC_INSTALL_PATH}/bin/protoc ]; then
1819
curl -LO ${PB_REL}/download/v${PROTOBUFF_VERSION}/${PROTOC_ZIP_NAME}
1920
echo "Unzipping protoc"
2021
unzip -o ${PROTOC_ZIP_NAME} -d ${PROTOC_INSTALL_PATH}
21-
chmod +x ${PROTOC_INSTALL_PATH}/bin/protoc
22+
chmod +x ${PROTOC_INSTALL_PATH}/bin/protoc
2223
export PATH=${PROTOC_INSTALL_PATH}/bin:$PATH
2324
echo "Removing protoc zip"
2425
rm ${PROTOC_ZIP_NAME}
@@ -31,15 +32,15 @@ fi
3132
# install protoc-gen-go
3233
if [ ! -f ${GOPATH}/bin/protoc-gen-go ]; then
3334
echo "Installing protoc-gen-go"
34-
go install github.com/golang/protobuf/[email protected]
35+
go install -modfile=${REPO_ROOT}/tools.go.mod github.com/golang/protobuf/[email protected]
3536
else
3637
echo "protoc-gen-go already installed at ${GOPATH}/bin/protoc-gen-go"
3738
fi
3839

3940
# install protoc-gen-go-grpc
4041
if [ ! -f ${GOPATH}/bin/protoc-gen-go-grpc ]; then
4142
echo "Installing protoc-gen-go-grpc"
42-
go install google.golang.org/grpc/cmd/[email protected]
43+
go install -modfile=${REPO_ROOT}/tools.go.mod google.golang.org/grpc/cmd/[email protected]
4344
else
4445
echo "protoc-gen-go-grpc already installed at ${GOPATH}/bin/protoc-gen-go-grpc"
4546
fi

0 commit comments

Comments
 (0)