File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,13 @@ IMG ?= {{ .Image }}
48
48
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
49
49
CRD_OPTIONS ?= "crd:trivialVersions=true"
50
50
51
+ # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
52
+ ifeq (,$(shell go env GOBIN))
53
+ GOBIN=$(shell go env GOPATH)/bin
54
+ else
55
+ GOBIN=$(shell go env GOBIN)
56
+ endif
57
+
51
58
all: manager
52
59
53
60
# Run tests
@@ -102,7 +109,7 @@ docker-push:
102
109
controller-gen:
103
110
ifeq (, $(shell which controller-gen))
104
111
go get sigs.k8s.io/controller-tools/cmd/[email protected]
105
- CONTROLLER_GEN=$(shell go env GOPATH)/bin /controller-gen
112
+ CONTROLLER_GEN=$(GOBIN) /controller-gen
106
113
else
107
114
CONTROLLER_GEN=$(shell which controller-gen)
108
115
endif
Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ IMG ?= controller:latest
4
4
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
5
5
CRD_OPTIONS ?= "crd:trivialVersions=true"
6
6
7
+ # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
8
+ ifeq (,$(shell go env GOBIN) )
9
+ GOBIN =$(shell go env GOPATH) /bin
10
+ else
11
+ GOBIN =$(shell go env GOBIN)
12
+ endif
13
+
7
14
all : manager
8
15
9
16
# Run tests
@@ -58,7 +65,7 @@ docker-push:
58
65
controller-gen :
59
66
ifeq (, $(shell which controller-gen) )
60
67
go get sigs.k8s.io/controller-tools/cmd/
[email protected]
61
- CONTROLLER_GEN =$(shell go env GOPATH) /bin /controller-gen
68
+ CONTROLLER_GEN =$(GOBIN ) /controller-gen
62
69
else
63
70
CONTROLLER_GEN =$(shell which controller-gen)
64
71
endif
You can’t perform that action at this time.
0 commit comments