From 717b09458ba16334c957208a33d32bcd4ec307df Mon Sep 17 00:00:00 2001 From: Xiangjing Li <55890329+xiangjingli@users.noreply.github.com> Date: Thu, 2 May 2024 21:00:29 -0400 Subject: [PATCH] label selector is no longer supported in ManagedClusterSet (#99) Signed-off-by: Xiangjing Li (cherry picked from commit d6d579657f49c257b74d1fd5ed7d7eaef9e7cf52) --- Makefile | 5 ++++- examples/managedclusterset.yaml | 16 ---------------- examples/managedclustersetbinding.yaml | 4 ++-- examples/openshift-gitops/README.md | 2 +- examples/openshift-gitops/managedclusterset.yaml | 12 ------------ .../managedclustersetbinding.yaml | 4 ++-- 6 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 examples/managedclusterset.yaml delete mode 100644 examples/openshift-gitops/managedclusterset.yaml diff --git a/Makefile b/Makefile index 3d6efa7..a7dbc94 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,9 @@ GOHOSTARCH ?= $(shell go env GOHOSTARCH) KB_TOOLS_ARCHIVE_NAME :=kubebuilder-tools-$(K8S_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz KB_TOOLS_ARCHIVE_PATH := $(TEST_TMP)/$(KB_TOOLS_ARCHIVE_NAME) +# specify the tag for ocm foundation images used in e2e test +OCM_IMAGE_TAG ?= v0.13.0 + .PHONY: build build: @@ -113,7 +116,7 @@ $(CONTROLLER_GEN): $(LOCALBIN) .PHONY: deploy-ocm deploy-ocm: - deploy/ocm/install.sh + IMAGE_TAG=$(OCM_IMAGE_TAG) deploy/ocm/install.sh .PHONY: test-e2e test-e2e: deploy-ocm diff --git a/examples/managedclusterset.yaml b/examples/managedclusterset.yaml deleted file mode 100644 index 07246a0..0000000 --- a/examples/managedclusterset.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Creates a ManagedClusterSet resource -# Important: LabelSelector is no longer supported in newer releases. -# Use the existing 'global' or 'default' ManagedClusterSet instead. -# You do not need to apply this file. -# Skip to managedclustersetbinding.yaml. ---- -apiVersion: cluster.open-cluster-management.io/v1beta2 -kind: ManagedClusterSet -metadata: - name: all-openshift-clusters -spec: - clusterSelector: - labelSelector: - matchLabels: - vendor: OpenShift - selectorType: LabelSelector diff --git a/examples/managedclustersetbinding.yaml b/examples/managedclustersetbinding.yaml index 9091197..66ce113 100644 --- a/examples/managedclustersetbinding.yaml +++ b/examples/managedclustersetbinding.yaml @@ -3,7 +3,7 @@ apiVersion: cluster.open-cluster-management.io/v1beta2 kind: ManagedClusterSetBinding metadata: - name: all-openshift-clusters + name: global namespace: openshift-gitops spec: - clusterSet: all-openshift-clusters # Important: in newer releases use the 'global' or 'default' for clusterSet value instead. + clusterSet: global diff --git a/examples/openshift-gitops/README.md b/examples/openshift-gitops/README.md index 6d054be..a4c7678 100644 --- a/examples/openshift-gitops/README.md +++ b/examples/openshift-gitops/README.md @@ -10,7 +10,7 @@ with the `vendor: OpenShift` label into OpenShift GitOps (Argo CD). ## Configure * Apply the following: ```shell - kubectl apply -f . + kubectl apply -f ./openshift-gitops ``` * Any OpenShift clusters with the correct label will be imported into the Argo CD provisioned by OpenShift GitOps. * Check the Openshift GitOps (Argo CD) Configuration tab, to see the list of clusters diff --git a/examples/openshift-gitops/managedclusterset.yaml b/examples/openshift-gitops/managedclusterset.yaml deleted file mode 100644 index ea96c4c..0000000 --- a/examples/openshift-gitops/managedclusterset.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Creates a ManagedClusterSet resource ---- -apiVersion: cluster.open-cluster-management.io/v1beta2 -kind: ManagedClusterSet -metadata: - name: all-openshift-clusters -spec: - clusterSelector: - labelSelector: - matchLabels: - vendor: OpenShift - selectorType: LabelSelector diff --git a/examples/openshift-gitops/managedclustersetbinding.yaml b/examples/openshift-gitops/managedclustersetbinding.yaml index abb5898..66ce113 100644 --- a/examples/openshift-gitops/managedclustersetbinding.yaml +++ b/examples/openshift-gitops/managedclustersetbinding.yaml @@ -3,7 +3,7 @@ apiVersion: cluster.open-cluster-management.io/v1beta2 kind: ManagedClusterSetBinding metadata: - name: all-openshift-clusters + name: global namespace: openshift-gitops spec: - clusterSet: all-openshift-clusters + clusterSet: global