diff --git a/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go b/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go index 870c7be..66d2af2 100644 --- a/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go @@ -119,13 +119,17 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform ##@ Deployment +ifndef ignore-not-found + ignore-not-found = false +endif + .PHONY: install install: kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/crd | kubectl apply -f - .PHONY: uninstall uninstall: kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl delete -f - + $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: deploy deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. @@ -134,7 +138,7 @@ deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/c .PHONY: undeploy undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/default | kubectl delete -f - + $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - OS := $(shell uname -s | tr '[:upper:]' '[:lower:]') ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') diff --git a/testdata/memcached-molecule-operator/Makefile b/testdata/memcached-molecule-operator/Makefile index f9d5671..e77165a 100644 --- a/testdata/memcached-molecule-operator/Makefile +++ b/testdata/memcached-molecule-operator/Makefile @@ -53,13 +53,17 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform ##@ Deployment +ifndef ignore-not-found + ignore-not-found = false +endif + .PHONY: install install: kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/crd | kubectl apply -f - .PHONY: uninstall uninstall: kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl delete -f - + $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: deploy deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. @@ -68,7 +72,7 @@ deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/c .PHONY: undeploy undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/default | kubectl delete -f - + $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - OS := $(shell uname -s | tr '[:upper:]' '[:lower:]') ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')