Skip to content

Commit 1876b67

Browse files
committed
chore: address comments
1 parent a484054 commit 1876b67

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
@@ -20,7 +20,7 @@ stages:
2020
{ { { {
2121
sudo -E env "PATH=$PATH" make test-all;
2222
echo $? >&3;
23-
} | tee >(go tool go-junit-report > report.xml) >&4;
23+
} | tee >(go tool -modfile=tools.go.mod go-junit-report > report.xml) >&4;
2424
} 3>&1;
2525
} | { read xs; exit $xs; }
2626
} 4>&1

Makefile

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

861861
FMT_PKG ?= cni cns npm
862862

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

866866

867867
workspace: ## Set up the Go workspace.
@@ -943,7 +943,7 @@ dockerfiles: renderkit ## Render all Dockerfile templates with current state of
943943
@make -f build/images.mk render PATH=cns
944944
@make -f build/images.mk render PATH=cni
945945

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

968968
##@ Tools
969969

970-
tools: renderkit controller-gen
970+
tools: renderkit
971971

972972
renderkit: ## Install renderkit for rendering Dockerfile templates
973973
@go install -modfile=$(TOOLS_GO_MOD) github.com/orellazri/renderkit
974974

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

978976
##@ Help
979977

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)