Skip to content

Commit

Permalink
Patch args when redeploying controller
Browse files Browse the repository at this point in the history
These are set by the framework, but overwritten when applying the
`operator.yaml`.

ref: https://issues.redhat.com/browse/ACM-4873
Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Oct 4, 2023
1 parent 268da73 commit 36b4d61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ MANAGED_CLUSTER_NAME ?= managed
HUB_CONFIG ?= $(PWD)/kubeconfig_hub
HUB_CONFIG_INTERNAL ?= $(PWD)/kubeconfig_hub_internal
MANAGED_CONFIG ?= $(PWD)/kubeconfig_managed
deployOnHub ?= false
# Set the Kind version tag
ifeq ($(KIND_VERSION), minimum)
KIND_ARGS = --image kindest/node:v1.19.16
Expand Down Expand Up @@ -246,6 +247,7 @@ kind-deploy-controller-dev: kind-deploy-controller
@echo Pushing image to KinD cluster
kind load docker-image $(REGISTRY)/$(IMG):$(TAG) --name $(KIND_NAME)
@echo "Patch deployment image"
kubectl patch deployment $(IMG) -n $(KIND_NAMESPACE) -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$(IMG)\",\"args\":[\"--hub-cluster-configfile=/var/run/klusterlet/kubeconfig\", \"--cluster-namespace=$(MANAGED_CLUSTER_NAME)\", \"--enable-lease=true\", \"--log-level=2\", \"--disable-spec-sync=$(deployOnHub)\"]}]}}}}"
kubectl patch deployment $(IMG) -n $(KIND_NAMESPACE) -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$(IMG)\",\"imagePullPolicy\":\"Never\"}]}}}}" --kubeconfig=$(MANAGED_CONFIG)
kubectl patch deployment $(IMG) -n $(KIND_NAMESPACE) -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$(IMG)\",\"image\":\"$(REGISTRY)/$(IMG):$(TAG)\"}]}}}}" --kubeconfig=$(MANAGED_CONFIG)
kubectl rollout status -n $(KIND_NAMESPACE) deployment $(IMG) --timeout=180s --kubeconfig=$(MANAGED_CONFIG)
Expand Down

0 comments on commit 36b4d61

Please sign in to comment.