Skip to content

Commit 25d1717

Browse files
authored
Merge pull request #5139 from mayuka-c/issue-5134
🐛 (go/v4): Fix an issue where project scaffolding failed when directories contained spaces by quoting Makefile variables
2 parents dcb76da + 5939961 commit 25d1717

File tree

8 files changed

+150
-150
lines changed

8 files changed

+150
-150
lines changed

docs/book/src/cronjob-tutorial/testdata/project/Makefile

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
4747
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
4848
# is created by K8s API to store the latest version of the resource ( kubectl.kubernetes.io/last-applied-configuration).
4949
# However, it has a size limit and if the CRD is too big with so many long descriptions as this one it will cause the failure.
50-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
50+
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
5151

5252
.PHONY: generate
5353
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
54-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
54+
"$(CONTROLLER_GEN)" object:headerFile="hack/boilerplate.go.txt" paths="./..."
5555

5656
.PHONY: fmt
5757
fmt: ## Run go fmt against code.
@@ -63,7 +63,7 @@ vet: ## Run go vet against code.
6363

6464
.PHONY: test
6565
test: manifests generate fmt vet setup-envtest ## Run tests.
66-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
66+
KUBEBUILDER_ASSETS="$(shell "$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
6767

6868
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
6969
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
@@ -96,15 +96,15 @@ cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests
9696

9797
.PHONY: lint
9898
lint: golangci-lint ## Run golangci-lint linter
99-
$(GOLANGCI_LINT) run
99+
"$(GOLANGCI_LINT)" run
100100

101101
.PHONY: lint-fix
102102
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
103-
$(GOLANGCI_LINT) run --fix
103+
"$(GOLANGCI_LINT)" run --fix
104104

105105
.PHONY: lint-config
106106
lint-config: golangci-lint ## Verify golangci-lint linter configuration
107-
$(GOLANGCI_LINT) config verify
107+
"$(GOLANGCI_LINT)" config verify
108108

109109
##@ Build
110110

@@ -147,8 +147,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
147147
.PHONY: build-installer
148148
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
149149
mkdir -p dist
150-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
151-
$(KUSTOMIZE) build config/default > dist/install.yaml
150+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
151+
"$(KUSTOMIZE)" build config/default > dist/install.yaml
152152

153153
##@ Deployment
154154

@@ -158,29 +158,29 @@ endif
158158

159159
.PHONY: install
160160
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
161-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
162-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) apply -f -; else echo "No CRDs to install; skipping."; fi
161+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
162+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" apply -f -; else echo "No CRDs to install; skipping."; fi
163163

164164
.PHONY: uninstall
165165
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
166-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
167-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
166+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
167+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
168168

169169
.PHONY: deploy
170170
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
171-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
172-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
171+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
172+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" apply -f -
173173

174174
.PHONY: undeploy
175175
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
176-
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
176+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -
177177

178178
##@ Dependencies
179179

180180
## Location to install dependencies to
181181
LOCALBIN ?= $(shell pwd)/bin
182182
$(LOCALBIN):
183-
mkdir -p $(LOCALBIN)
183+
mkdir -p "$(LOCALBIN)"
184184

185185
## Tool Binaries
186186
KUBECTL ?= kubectl
@@ -212,7 +212,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
212212
.PHONY: setup-envtest
213213
setup-envtest: envtest ## Download the binaries required for ENVTEST in the local bin directory.
214214
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)..."
215-
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
215+
@"$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path || { \
216216
echo "Error: Failed to set up envtest binaries for version $(ENVTEST_K8S_VERSION)."; \
217217
exit 1; \
218218
}
@@ -236,9 +236,9 @@ define go-install-tool
236236
set -e; \
237237
package=$(2)@$(3) ;\
238238
echo "Downloading $${package}" ;\
239-
rm -f $(1) ;\
240-
GOBIN=$(LOCALBIN) go install $${package} ;\
241-
mv $(1) $(1)-$(3) ;\
239+
rm -f "$(1)" ;\
240+
GOBIN="$(LOCALBIN)" go install $${package} ;\
241+
mv "$(LOCALBIN)/$$(basename "$(1)")" "$(1)-$(3)" ;\
242242
} ;\
243-
ln -sf $$(realpath $(1)-$(3)) $(1)
243+
ln -sf "$$(realpath "$(1)-$(3)")" "$(1)"
244244
endef

docs/book/src/getting-started/testdata/project/Makefile

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ help: ## Display this help.
4343

4444
.PHONY: manifests
4545
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
46-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
46+
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4747

4848
.PHONY: generate
4949
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
50-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
50+
"$(CONTROLLER_GEN)" object:headerFile="hack/boilerplate.go.txt" paths="./..."
5151

5252
.PHONY: fmt
5353
fmt: ## Run go fmt against code.
@@ -59,7 +59,7 @@ vet: ## Run go vet against code.
5959

6060
.PHONY: test
6161
test: manifests generate fmt vet setup-envtest ## Run tests.
62-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
62+
KUBEBUILDER_ASSETS="$(shell "$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
6363

6464
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
@@ -92,15 +92,15 @@ cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests
9292

9393
.PHONY: lint
9494
lint: golangci-lint ## Run golangci-lint linter
95-
$(GOLANGCI_LINT) run
95+
"$(GOLANGCI_LINT)" run
9696

9797
.PHONY: lint-fix
9898
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
99-
$(GOLANGCI_LINT) run --fix
99+
"$(GOLANGCI_LINT)" run --fix
100100

101101
.PHONY: lint-config
102102
lint-config: golangci-lint ## Verify golangci-lint linter configuration
103-
$(GOLANGCI_LINT) config verify
103+
"$(GOLANGCI_LINT)" config verify
104104

105105
##@ Build
106106

@@ -143,8 +143,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
143143
.PHONY: build-installer
144144
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
145145
mkdir -p dist
146-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
147-
$(KUSTOMIZE) build config/default > dist/install.yaml
146+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
147+
"$(KUSTOMIZE)" build config/default > dist/install.yaml
148148

149149
##@ Deployment
150150

@@ -154,29 +154,29 @@ endif
154154

155155
.PHONY: install
156156
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
158-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) apply -f -; else echo "No CRDs to install; skipping."; fi
157+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
158+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" apply -f -; else echo "No CRDs to install; skipping."; fi
159159

160160
.PHONY: uninstall
161161
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
162-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
163-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
162+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
163+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
164164

165165
.PHONY: deploy
166166
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
167-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
168-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
167+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
168+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" apply -f -
169169

170170
.PHONY: undeploy
171171
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
172-
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
172+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -
173173

174174
##@ Dependencies
175175

176176
## Location to install dependencies to
177177
LOCALBIN ?= $(shell pwd)/bin
178178
$(LOCALBIN):
179-
mkdir -p $(LOCALBIN)
179+
mkdir -p "$(LOCALBIN)"
180180

181181
## Tool Binaries
182182
KUBECTL ?= kubectl
@@ -208,7 +208,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
208208
.PHONY: setup-envtest
209209
setup-envtest: envtest ## Download the binaries required for ENVTEST in the local bin directory.
210210
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)..."
211-
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
211+
@"$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path || { \
212212
echo "Error: Failed to set up envtest binaries for version $(ENVTEST_K8S_VERSION)."; \
213213
exit 1; \
214214
}
@@ -232,9 +232,9 @@ define go-install-tool
232232
set -e; \
233233
package=$(2)@$(3) ;\
234234
echo "Downloading $${package}" ;\
235-
rm -f $(1) ;\
236-
GOBIN=$(LOCALBIN) go install $${package} ;\
237-
mv $(1) $(1)-$(3) ;\
235+
rm -f "$(1)" ;\
236+
GOBIN="$(LOCALBIN)" go install $${package} ;\
237+
mv "$(LOCALBIN)/$$(basename "$(1)")" "$(1)-$(3)" ;\
238238
} ;\
239-
ln -sf $$(realpath $(1)-$(3)) $(1)
239+
ln -sf "$$(realpath "$(1)-$(3)")" "$(1)"
240240
endef

docs/book/src/multiversion-tutorial/testdata/project/Makefile

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
4747
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
4848
# is created by K8s API to store the latest version of the resource ( kubectl.kubernetes.io/last-applied-configuration).
4949
# However, it has a size limit and if the CRD is too big with so many long descriptions as this one it will cause the failure.
50-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
50+
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
5151

5252
.PHONY: generate
5353
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
54-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
54+
"$(CONTROLLER_GEN)" object:headerFile="hack/boilerplate.go.txt" paths="./..."
5555

5656
.PHONY: fmt
5757
fmt: ## Run go fmt against code.
@@ -63,7 +63,7 @@ vet: ## Run go vet against code.
6363

6464
.PHONY: test
6565
test: manifests generate fmt vet setup-envtest ## Run tests.
66-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
66+
KUBEBUILDER_ASSETS="$(shell "$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
6767

6868
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
6969
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
@@ -96,15 +96,15 @@ cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests
9696

9797
.PHONY: lint
9898
lint: golangci-lint ## Run golangci-lint linter
99-
$(GOLANGCI_LINT) run
99+
"$(GOLANGCI_LINT)" run
100100

101101
.PHONY: lint-fix
102102
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
103-
$(GOLANGCI_LINT) run --fix
103+
"$(GOLANGCI_LINT)" run --fix
104104

105105
.PHONY: lint-config
106106
lint-config: golangci-lint ## Verify golangci-lint linter configuration
107-
$(GOLANGCI_LINT) config verify
107+
"$(GOLANGCI_LINT)" config verify
108108

109109
##@ Build
110110

@@ -147,8 +147,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
147147
.PHONY: build-installer
148148
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
149149
mkdir -p dist
150-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
151-
$(KUSTOMIZE) build config/default > dist/install.yaml
150+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
151+
"$(KUSTOMIZE)" build config/default > dist/install.yaml
152152

153153
##@ Deployment
154154

@@ -158,29 +158,29 @@ endif
158158

159159
.PHONY: install
160160
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
161-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
162-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) apply -f -; else echo "No CRDs to install; skipping."; fi
161+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
162+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" apply -f -; else echo "No CRDs to install; skipping."; fi
163163

164164
.PHONY: uninstall
165165
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
166-
@out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
167-
if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
166+
@out="$$( "$(KUSTOMIZE)" build config/crd 2>/dev/null || true )"; \
167+
if [ -n "$$out" ]; then echo "$$out" | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
168168

169169
.PHONY: deploy
170170
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
171-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
172-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
171+
cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG}
172+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" apply -f -
173173

174174
.PHONY: undeploy
175175
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
176-
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
176+
"$(KUSTOMIZE)" build config/default | "$(KUBECTL)" delete --ignore-not-found=$(ignore-not-found) -f -
177177

178178
##@ Dependencies
179179

180180
## Location to install dependencies to
181181
LOCALBIN ?= $(shell pwd)/bin
182182
$(LOCALBIN):
183-
mkdir -p $(LOCALBIN)
183+
mkdir -p "$(LOCALBIN)"
184184

185185
## Tool Binaries
186186
KUBECTL ?= kubectl
@@ -212,7 +212,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
212212
.PHONY: setup-envtest
213213
setup-envtest: envtest ## Download the binaries required for ENVTEST in the local bin directory.
214214
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)..."
215-
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
215+
@"$(ENVTEST)" use $(ENVTEST_K8S_VERSION) --bin-dir "$(LOCALBIN)" -p path || { \
216216
echo "Error: Failed to set up envtest binaries for version $(ENVTEST_K8S_VERSION)."; \
217217
exit 1; \
218218
}
@@ -236,9 +236,9 @@ define go-install-tool
236236
set -e; \
237237
package=$(2)@$(3) ;\
238238
echo "Downloading $${package}" ;\
239-
rm -f $(1) ;\
240-
GOBIN=$(LOCALBIN) go install $${package} ;\
241-
mv $(1) $(1)-$(3) ;\
239+
rm -f "$(1)" ;\
240+
GOBIN="$(LOCALBIN)" go install $${package} ;\
241+
mv "$(LOCALBIN)/$$(basename "$(1)")" "$(1)-$(3)" ;\
242242
} ;\
243-
ln -sf $$(realpath $(1)-$(3)) $(1)
243+
ln -sf "$$(realpath "$(1)-$(3)")" "$(1)"
244244
endef

hack/docs/internal/cronjob-tutorial/generate_cronjob.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,15 @@ CronJob controller's`+" `"+`SetupWithManager`+"`"+` method.
380380
func (sp *Sample) updateMakefile() {
381381
const originalManifestTarget = `.PHONY: manifests
382382
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
383-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
383+
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
384384
`
385385
const changedManifestTarget = `.PHONY: manifests
386386
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
387387
# Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
388388
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
389389
# is created by K8s API to store the latest version of the resource ( kubectl.kubernetes.io/last-applied-configuration).
390390
# However, it has a size limit and if the CRD is too big with so many long descriptions as this one it will cause the failure.
391-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
391+
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
392392
`
393393
err := pluginutil.ReplaceInFile(filepath.Join(sp.ctx.Dir, "Makefile"), originalManifestTarget, changedManifestTarget)
394394
hackutils.CheckError("updating makefile to use maxDescLen=0 in make manifest target", err)

0 commit comments

Comments
 (0)