File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,17 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k
187
187
.PHONY : kustomize
188
188
kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
189
189
$(KUSTOMIZE ) : $(LOCALBIN )
190
- test -s $(LOCALBIN ) /kustomize || { curl -s $( KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( LOCALBIN) }
190
+ @if test -x $(LOCALBIN ) /kustomize && ! $(LOCALBIN ) /kustomize version | grep -q $(KUSTOMIZE_VERSION ) ; then \
191
+ echo " $( LOCALBIN) /kustomize version is not expected $( KUSTOMIZE_VERSION) . Removing it before installing." ; \
192
+ rm -rf $(LOCALBIN ) /kustomize; \
193
+ fi
194
+ test -s $(LOCALBIN ) /kustomize || { curl -Ss $( KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( LOCALBIN) ; }
191
195
192
196
.PHONY : controller-gen
193
197
controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
194
198
$(CONTROLLER_GEN ) : $(LOCALBIN )
195
- test -s $(LOCALBIN ) /controller-gen || GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION )
199
+ test -s $(LOCALBIN ) /controller-gen && $(LOCALBIN ) /controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION ) || \
200
+ GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION )
196
201
197
202
.PHONY : envtest
198
203
envtest : $(ENVTEST ) # # Download envtest-setup locally if necessary.
You can’t perform that action at this time.
0 commit comments