Skip to content

Commit

Permalink
Reset manifests after apply
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek authored and openshift-ci[bot] committed Nov 3, 2023
1 parent 4593faf commit 3fbc130
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,28 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
$(KUSTOMIZE) build config/crd | kubectl delete -f -

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
deploy: manifests kustomize patch-deployment apply-manifests unpatch-deployment ## Deploy controller to the K8s cluster specified in ~/.kube/config.

.PHONY: apply-manifests
apply-manifests:
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: patch-deployment
patch-deployment:
cd config/default && $(KUSTOMIZE) edit set namespace $(NAMESPACE)
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: unpatch-deployment
unpatch-deployment:
cd config/default && $(KUSTOMIZE) edit set namespace gatekeeper-system
cd config/manager && $(KUSTOMIZE) edit set image controller=quay.io/gatekeeper/gatekeeper-operator:v$(VERSION)

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -

.PHONY: deploy-ci
deploy-ci: install patch-image deploy ## Deploys the controller with a patched pull policy.
deploy-ci: install patch-image deploy unpatch-image ## Deploys the controller with a patched pull policy.

.PHONY: deploy-olm
deploy-olm:
Expand All @@ -260,6 +271,10 @@ deploy-using-olm:
patch-image: ## Patches the manager's image pull policy to be IfNotPresent.
$(SED) -i 's/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g' config/manager/manager.yaml

.PHONY: unpatch-image
unpatch-image: ## Patches the manager's image pull policy to be Always.
$(SED) -i 's/imagePullPolicy: IfNotPresent/imagePullPolicy: Always/g' config/manager/manager.yaml

.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,sigs.k8s.io/controller-tools/cmd/[email protected])
Expand Down

0 comments on commit 3fbc130

Please sign in to comment.