From a768f5b5045d64b145de75d8a8642cb56f030c7b Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Wed, 15 Nov 2023 11:21:32 +0000 Subject: [PATCH] Fix gateway controller deploy target `make deploy-gateway-controller` deploys both the gateway and policy controller but was only updating the image for the gateway controller to the locally built version. This change updates the make targets to ensure that both the gateway and policy controller images are updated when testing the combined gateway/policy controller installation (e2e tests). --- config/manager/kustomization.yaml | 2 +- config/policy-controller/manager/kustomization.yaml | 4 +--- hack/make/gateway_controller.make | 7 +++++-- hack/make/policy_controller.make | 7 +++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index d14ea472..cf5e1b32 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,4 +4,4 @@ resources: images: - name: controller newName: quay.io/kuadrant/multicluster-gateway-controller - newTag: main \ No newline at end of file + newTag: main diff --git a/config/policy-controller/manager/kustomization.yaml b/config/policy-controller/manager/kustomization.yaml index 441a2bc8..34493726 100644 --- a/config/policy-controller/manager/kustomization.yaml +++ b/config/policy-controller/manager/kustomization.yaml @@ -1,9 +1,7 @@ - - resources: - manager.yaml images: - name: policy-controller newName: quay.io/kuadrant/policy-controller - newTag: main \ No newline at end of file + newTag: main diff --git a/hack/make/gateway_controller.make b/hack/make/gateway_controller.make index 8b78bcaf..1d4401de 100644 --- a/hack/make/gateway_controller.make +++ b/hack/make/gateway_controller.make @@ -27,9 +27,12 @@ kind-load-gateway-controller: docker-build-gateway-controller docker-push-gateway-controller: ## Push docker image with the controller. docker push ${CONTROLLER_IMG} -.PHONY: deploy-gateway-controller -deploy-gateway-controller: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. +.PHONY: update-gateway-controller-image +update-gateway-controller-image: kustomize ## Update gateway controller image to CONTROLLER_IMG. cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG} + +.PHONY: deploy-gateway-controller +deploy-gateway-controller: manifests kustomize update-gateway-controller-image update-policy-controller-image ## Deploy controller to the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) --load-restrictor LoadRestrictionsNone build config/deploy/local | kubectl apply -f - @if [ "$(METRICS)" = "true" ]; then\ $(KUSTOMIZE) build config/prometheus | kubectl apply -f -;\ diff --git a/hack/make/policy_controller.make b/hack/make/policy_controller.make index b97c2e04..5c198747 100644 --- a/hack/make/policy_controller.make +++ b/hack/make/policy_controller.make @@ -39,9 +39,12 @@ kind-load-policy-controller: docker-build-policy-controller docker-push-policy-controller: ## Push docker image with the controller. docker push ${POLICY_CONTROLLER_IMG} +.PHONY: update-policy-controller-image +update-policy-controller-image: kustomize ## Update policy controller image to POLICY_CONTROLLER_IMG. + cd config/policy-controller/manager && $(KUSTOMIZE) edit set image policy-controller=${POLICY_CONTROLLER_IMG} + .PHONY: deploy-policy-controller -deploy-policy-controller: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/policy-controller/default && $(KUSTOMIZE) edit set image policy-controller=${POLICY_CONTROLLER_IMG} +deploy-policy-controller: kustomize manifests update-policy-controller-image ## Deploy policy controller to the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) --load-restrictor LoadRestrictionsNone build config/policy-controller/default | kubectl apply -f - @if [ "$(METRICS)" = "true" ]; then\ $(KUSTOMIZE) build config/prometheus | kubectl apply -f -;\