@@ -88,18 +88,23 @@ GOLANGCI_LINT_VER := v1.55.2
88
88
GOLANGCI_LINT_BIN := golangci-lint
89
89
GOLANGCI_LINT := $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) -$(GOLANGCI_LINT_VER )
90
90
91
- # Keep at 4.0.4 until we figure out how to get later verisons to not mangle the calico yamls
92
- # HACK bump latest version once https://github.com/kubernetes-sigs/kustomize/issues/947 is fixed
93
- KUSTOMIZE_VER := v4.0.4
91
+ # Sync to version in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/Makefile
92
+ KUSTOMIZE_VER := v4.5.2
94
93
KUSTOMIZE_BIN := kustomize
95
- KUSTOMIZE := $(TOOLS_BIN_DIR ) /$(KUSTOMIZE_BIN ) -$(KUSTOMIZE_VER )
94
+ KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR ) /$(KUSTOMIZE_BIN ) -$(KUSTOMIZE_VER ) )
95
+ KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v4
96
96
97
97
# Sync to github.com/onsi/ginkgo verison in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
98
98
GINKGO_VER := v2.17.1
99
99
GINKGO_BIN := ginkgo
100
100
GINKGO := $(abspath $(TOOLS_BIN_DIR ) /$(GINKGO_BIN ) -$(GINKGO_VER ) )
101
101
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
102
102
103
+ YQ_VER := v4.35.2
104
+ YQ_BIN := yq
105
+ YQ := $(abspath $(TOOLS_BIN_DIR ) /$(YQ_BIN ) -$(YQ_VER ) )
106
+ YQ_PKG := github.com/mikefarah/yq/v4
107
+
103
108
TIMEOUT := $(shell command -v timeout || command -v gtimeout)
104
109
105
110
# Define Docker related variables. Releases should modify and double check these vars.
@@ -241,13 +246,8 @@ $(ENVSUBST): ## Build envsubst from tools folder.
241
246
$(GOLANGCI_LINT ) : # # Build golangci-lint from tools folder.
242
247
GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) github.com/golangci/golangci-lint/cmd/golangci-lint $(GOLANGCI_LINT_BIN ) $(GOLANGCI_LINT_VER )
243
248
244
- # # HACK replace with $(GO_INSTALL) once https://github.com/kubernetes-sigs/kustomize/issues/947 is fixed
245
- $(KUSTOMIZE ) : # # Put kustomize into tools folder.
246
- mkdir -p $(TOOLS_BIN_DIR )
247
- rm -f $(TOOLS_BIN_DIR ) /$(KUSTOMIZE_BIN ) *
248
- curl -fsSL " https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- $(KUSTOMIZE_VER:v%=% ) $(TOOLS_BIN_DIR )
249
- mv " $( TOOLS_BIN_DIR) /$( KUSTOMIZE_BIN) " $(KUSTOMIZE )
250
- ln -sf $(KUSTOMIZE ) " $( TOOLS_BIN_DIR) /$( KUSTOMIZE_BIN) "
249
+ $(KUSTOMIZE ) : # Build kustomize from tools folder.
250
+ CGO_ENABLED=0 GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) $(KUSTOMIZE_PKG ) $(KUSTOMIZE_BIN ) $(KUSTOMIZE_VER )
251
251
252
252
$(CONTROLLER_GEN ) : # # Build controller-gen from tools folder.
253
253
GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) sigs.k8s.io/controller-tools/cmd/controller-gen $(CONTROLLER_GEN_BIN ) $(CONTROLLER_GEN_VER )
@@ -258,6 +258,9 @@ $(CONVERSION_GEN): ## Build conversion-gen.
258
258
$(GINKGO ) : # Build ginkgo from tools folder.
259
259
GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) $(GINKGO_PKG ) $(GINKGO_BIN ) $(GINKGO_VER )
260
260
261
+ $(YQ ) : # Build yq.
262
+ GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) $(YQ_PKG ) $(YQ_BIN ) ${YQ_VER}
263
+
261
264
# # --------------------------------------
262
265
# # Linting
263
266
# # --------------------------------------
@@ -288,7 +291,7 @@ generate-templates: $(KUSTOMIZE) ## Generate cluster templates
288
291
$(KUSTOMIZE ) build templates/experimental-kube-vip-crs-cni --load-restrictor LoadRestrictionsNone > templates/cluster-template-kube-vip-crs-cni.yaml
289
292
$(KUSTOMIZE ) build templates/experimental-kube-vip --load-restrictor LoadRestrictionsNone > templates/cluster-template-kube-vip.yaml
290
293
$(KUSTOMIZE ) build templates/experimental-crs-cni --load-restrictor LoadRestrictionsNone > templates/cluster-template-crs-cni.yaml
291
- $(KUSTOMIZE ) build templates/addons/calico > templates/addons/calico.yaml
294
+ $(KUSTOMIZE ) build templates/addons/calico | $( YQ ) > templates/addons/calico.yaml
292
295
293
296
.PHONY : generate-go
294
297
generate-go : $(CONTROLLER_GEN ) $(CONVERSION_GEN ) # # Runs Go related generate targets
0 commit comments