Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit 85a507b

Browse files
committed
Downgrade controller-gen to v0.7.0
In commit ea79796 ("update to operator-sdk 1.3.0 (#848)"), we upgraded controller-gen to 0.8.0. However, v0.8.0 requires go 1.17 or greater, which is currently unavailable in Red Hat's container registries (i.e. there's no container on catalog.redhat.com); consequently, SBO is built with go 1.16. Until that is rectified, downgrade controller-gen to 0.7.0, which builds with go 1.16. At the same time, we should be using `go install` instead of the now deprecated `go get` when we install tools. There are still a few tools that require `go get`, but for those that don't, we should use the new installation method. This requires a version bump of kustomize to work. Signed-off-by: Andy Sadler <[email protected]>
1 parent 5060f43 commit 85a507b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

hack/common.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,37 @@ gen-mocks: mockgen
8888
# Download controller-gen locally if necessary
8989
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
9090
controller-gen:
91-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0)
91+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
9292

9393
# Download kustomize locally if necessary
9494
KUSTOMIZE = $(shell pwd)/bin/kustomize
9595
kustomize:
96-
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
96+
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
9797

98-
# go-get-tool will 'go get' any package $2 and install it to $1.
99-
define go-get-tool
98+
# go-install-tool will 'go install' any package $2 and install it to $1.
99+
define go-install-tool
100100
@[ -f $(1) ] || { \
101101
set -e ;\
102102
TMP_DIR=$$(mktemp -d) ;\
103103
cd $$TMP_DIR ;\
104104
go mod init tmp ;\
105105
echo "Downloading $(2)" ;\
106-
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
106+
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
107107
rm -rf $$TMP_DIR ;\
108108
}
109109
endef
110110

111111
YQ = $(shell pwd)/bin/yq
112112
yq:
113-
$(call go-get-tool,$(YQ),github.com/mikefarah/yq/[email protected])
113+
$(call go-install-tool,$(YQ),github.com/mikefarah/yq/[email protected])
114114

115115
KUBECTL_SLICE = $(shell pwd)/bin/kubectl-slice
116116
kubectl-slice:
117-
$(call go-get-tool,$(KUBECTL_SLICE),github.com/patrickdappollonio/[email protected])
117+
$(call go-install-tool,$(KUBECTL_SLICE),github.com/patrickdappollonio/[email protected])
118118

119119
MOCKGEN = $(shell pwd)/bin/mockgen
120120
mockgen:
121-
$(call go-get-tool,$(MOCKGEN),github.com/golang/mock/[email protected])
121+
$(call go-install-tool,$(MOCKGEN),github.com/golang/mock/[email protected])
122122

123123
.PHONY: opm
124124
OPM = $(shell pwd)/bin/opm
@@ -136,4 +136,4 @@ OPM = $(shell which opm)
136136
endif
137137
endif
138138

139-
all: build
139+
all: build

0 commit comments

Comments
 (0)