Skip to content

Commit

Permalink
Fix Hosted mode framework test (#141)
Browse files Browse the repository at this point in the history
Ref: https://issues.redhat.com/browse/ACM-6966

Signed-off-by: Yi Rae Kim <yikim@redhat.com>
  • Loading branch information
yiraeChristineKim authored and zyjjay committed Mar 15, 2024
1 parent fc01b9f commit ba6c130
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/framework-kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ on:
jobs:
fw-kind-tests:
name: KinD
uses: stolostron/governance-policy-framework/.github/workflows/kind.yml@main
uses: stolostron/governance-policy-framework/.github/workflows/kind.yml@main
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,23 @@ kind-bootstrap-cluster: kind-bootstrap-cluster-dev kind-deploy-controller
.PHONY: kind-bootstrap-cluster-dev
kind-bootstrap-cluster-dev: kind-create-all-clusters install-crds kind-controller-all-kubeconfigs


HOSTED ?= none

.PHONY: kind-deploy-controller-dev
kind-deploy-controller-dev:
if [ "$(HOSTED)" = "hosted" ]; then\
$(MAKE) kind-deploy-controller-dev-addon ;\
else\
$(MAKE) kind-deploy-controller-dev-normal ;\
fi

.PHONY: kind-deploy-controller
kind-deploy-controller: generate-operator-yaml install-resources deploy
-kubectl create secret -n $(KIND_NAMESPACE) generic hub-kubeconfig --from-file=kubeconfig=$(HUB_CONFIG_INTERNAL) --kubeconfig=$(MANAGED_CONFIG)_e2e

.PHONY: kind-deploy-controller-dev
kind-deploy-controller-dev: kind-deploy-controller
.PHONY: kind-deploy-controller-dev-normal
kind-deploy-controller-dev-normal: kind-deploy-controller
@echo Pushing image to KinD cluster
kind load docker-image $(REGISTRY)/$(IMG):$(TAG) --name $(KIND_NAME)
@echo "Patch deployment image"
Expand All @@ -187,6 +198,13 @@ kind-controller-all-kubeconfigs:
CLUSTER_NAME=$(HUB_CLUSTER_NAME) KIND_NAME=$(KIND_HUB_NAME) KIND_CLUSTER_NAME=$(KIND_HUB_CLUSTER_NAME) $(MAKE) kind-controller-kubeconfig
yq e '.clusters[0].cluster.server = "https://$(KIND_HUB_NAME)-control-plane:6443"' $(HUB_CONFIG) > $(HUB_CONFIG_INTERNAL)

.PHONY: kind-deploy-controller-dev-addon
kind-deploy-controller-dev-addon:
@echo Hosted mode test
kind load docker-image $(REGISTRY)/$(IMG):$(TAG) --name $(KIND_NAME)
kubectl annotate -n $(subst -hosted,,$(KIND_NAMESPACE)) --overwrite managedclusteraddon governance-policy-framework\
addon.open-cluster-management.io/values='{"global":{"imagePullPolicy": "Never", "imageOverrides":{"governance_policy_framework_addon": "$(REGISTRY)/$(IMG):$(TAG)"}}}'

.PHONY: kind-delete-cluster
kind-delete-cluster:
kind delete cluster --name $(KIND_HUB_NAME)
Expand Down

0 comments on commit ba6c130

Please sign in to comment.