Skip to content

Commit 1892e72

Browse files
ilaleksinansd
authored andcommitted
Added tools.go file
1 parent 585c609 commit 1892e72

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,8 @@ docker-registry-secret: check-env-docker-credentials operator-namespace
137137

138138
controller-gen: ## download controller-gen if not in $PATH
139139
ifeq (, $(shell which controller-gen))
140-
@{ \
141-
set -e ;\
142-
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
143-
cd $$CONTROLLER_GEN_TMP_DIR ;\
144-
go mod init tmp ;\
145-
go get sigs.k8s.io/controller-tools/cmd/[email protected] ;\
146-
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
147-
}
140+
@echo Installing tools from tools.go
141+
@cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
148142
ifeq (, $(GOBIN))
149143
GOBIN=$(GOPATH)/bin
150144
endif

config/crd/bases/rabbitmq.com_rabbitmqclusters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ apiVersion: apiextensions.k8s.io/v1
1010
kind: CustomResourceDefinition
1111
metadata:
1212
annotations:
13-
controller-gen.kubebuilder.io/version: v0.2.5
13+
controller-gen.kubebuilder.io/version: v0.4.0
1414
creationTimestamp: null
1515
name: rabbitmqclusters.rabbitmq.com
1616
spec:

tools.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// +build tools
2+
3+
package main
4+
5+
import (
6+
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
7+
)

0 commit comments

Comments
 (0)