Skip to content

Commit 1065a6d

Browse files
committed
chore: regenerate testdata and tutorials with updated Makefile scaffold
Run 'make install' and 'make generate' to update all samples and tutorials with the fix for handling empty CRD directories in install/uninstall targets
1 parent 2837bc3 commit 1065a6d

File tree

6 files changed

+36
-24
lines changed

6 files changed

+36
-24
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ ifndef ignore-not-found
157157
endif
158158

159159
.PHONY: install
160-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
160+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
162163

163164
.PHONY: uninstall
164-
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.
165-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
165+
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. No-op if none exist.
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
166168

167169
.PHONY: deploy
168170
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ ifndef ignore-not-found
153153
endif
154154

155155
.PHONY: install
156-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
156+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
158159

159160
.PHONY: uninstall
160-
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.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
161+
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. No-op if none exist.
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
162164

163165
.PHONY: deploy
164166
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ ifndef ignore-not-found
157157
endif
158158

159159
.PHONY: install
160-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
160+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
162163

163164
.PHONY: uninstall
164-
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.
165-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
165+
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. No-op if none exist.
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
166168

167169
.PHONY: deploy
168170
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

testdata/project-v4-multigroup/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ ifndef ignore-not-found
153153
endif
154154

155155
.PHONY: install
156-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
156+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
158159

159160
.PHONY: uninstall
160-
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.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
161+
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. No-op if none exist.
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
162164

163165
.PHONY: deploy
164166
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

testdata/project-v4-with-plugins/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ ifndef ignore-not-found
153153
endif
154154

155155
.PHONY: install
156-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
156+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
158159

159160
.PHONY: uninstall
160-
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.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
161+
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. No-op if none exist.
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
162164

163165
.PHONY: deploy
164166
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

testdata/project-v4/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ ifndef ignore-not-found
153153
endif
154154

155155
.PHONY: install
156-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
156+
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
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
158159

159160
.PHONY: uninstall
160-
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.
161-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
161+
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. No-op if none exist.
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
162164

163165
.PHONY: deploy
164166
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

0 commit comments

Comments
 (0)