From 3844ece80bc8081776acc776f847d6ca07b0e45d Mon Sep 17 00:00:00 2001 From: Leela Venkaiah G Date: Fri, 22 Mar 2024 10:01:37 +0530 Subject: [PATCH 1/2] bundle: added new ocs-client subscription Ran below commands from red-hat-storage/ocs-client-operator/tree/release-4.15 (ff31e31) and resulting images/values are used in this commit. export CLUSTER_ENV=openshift export VERSION=4.15.0 export IMG=quay.io/ocs-dev/ocs-client-operator:v${VERSION} export OCS_CLIENT_CONSOLE_IMG=\ quay.io/ocs-dev/ocs-client-console:v${VERSION} export CSI_ADDONS_PACKAGE_VERSION=0.7.0 export BUNDLE_IMG=quay.io/ocs-dev/ocs-client-operator-bundle:v${VERSION} make container-build container-push make bundle-build bundle-push Signed-off-by: Leela Venkaiah G --- .gitignore | 1 + Makefile | 7 +++++++ ...-operator-manager-config_v1_configmap.yaml | 6 ++++++ .../odf-operator.clusterserviceversion.yaml | 2 +- bundle/metadata/dependencies.yaml | 4 ++++ catalog/index.yaml | 11 ++++++++++ config/manager/manager.env | 6 ++++++ controllers/defaults.go | 14 +++++++++++++ controllers/subscriptions.go | 21 +++++++++++++++++-- hack/make-bundle-vars.mk | 15 ++++++++++++- 10 files changed, 83 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b5b5c7ecc..e02294a33 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ catalog/ocs.yaml catalog/odf.yaml catalog/rook.yaml catalog/prometheus.yaml +catalog/ocs-client.yaml diff --git a/Makefile b/Makefile index a509988cd..92fc8160d 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,12 @@ OCS_SUBSCRIPTION_CHANNEL=$(OCS_SUBSCRIPTION_CHANNEL) OCS_SUBSCRIPTION_STARTINGCSV=$(OCS_SUBSCRIPTION_STARTINGCSV) OCS_SUBSCRIPTION_CATALOGSOURCE=$(OCS_SUBSCRIPTION_CATALOGSOURCE) OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE) +OCS_CLIENT_SUBSCRIPTION_NAME=$(OCS_CLIENT_SUBSCRIPTION_NAME) +OCS_CLIENT_SUBSCRIPTION_PACKAGE=$(OCS_CLIENT_SUBSCRIPTION_PACKAGE) +OCS_CLIENT_SUBSCRIPTION_CHANNEL=$(OCS_CLIENT_SUBSCRIPTION_CHANNEL) +OCS_CLIENT_SUBSCRIPTION_STARTINGCSV=$(OCS_CLIENT_SUBSCRIPTION_STARTINGCSV) +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE=$(OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE) +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE) IBM_SUBSCRIPTION_NAME=$(IBM_SUBSCRIPTION_NAME) IBM_SUBSCRIPTION_PACKAGE=$(IBM_SUBSCRIPTION_PACKAGE) IBM_SUBSCRIPTION_CHANNEL=$(IBM_SUBSCRIPTION_CHANNEL) @@ -177,6 +183,7 @@ bundle-push: ## Push the bundle image. catalog: opm ## Generate catalog manifests and then validate generated files. $(OPM) render --output=yaml $(BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/odf.yaml $(OPM) render --output=yaml $(OCS_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/ocs.yaml + $(OPM) render --output=yaml $(OCS_CLIENT_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/ocs-client.yaml $(OPM) render --output=yaml $(IBM_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/ibm.yaml $(OPM) render --output=yaml $(NOOBAA_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/noobaa.yaml $(OPM) render --output=yaml $(CSIADDONS_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/csiaddons.yaml diff --git a/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml b/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml index 63f68086d..22f7c37ea 100644 --- a/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml +++ b/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml @@ -18,6 +18,12 @@ data: NOOBAA_SUBSCRIPTION_NAME: noobaa-operator NOOBAA_SUBSCRIPTION_PACKAGE: noobaa-operator NOOBAA_SUBSCRIPTION_STARTINGCSV: noobaa-operator.v5.14.0 + OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE: odf-catalogsource + OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace + OCS_CLIENT_SUBSCRIPTION_CHANNEL: alpha + OCS_CLIENT_SUBSCRIPTION_NAME: ocs-client-operator + OCS_CLIENT_SUBSCRIPTION_PACKAGE: ocs-client-operator + OCS_CLIENT_SUBSCRIPTION_STARTINGCSV: ocs-client-operator.v4.15.0 OCS_SUBSCRIPTION_CATALOGSOURCE: odf-catalogsource OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace OCS_SUBSCRIPTION_CHANNEL: alpha diff --git a/bundle/manifests/odf-operator.clusterserviceversion.yaml b/bundle/manifests/odf-operator.clusterserviceversion.yaml index 84db46e52..2b0c4862e 100644 --- a/bundle/manifests/odf-operator.clusterserviceversion.yaml +++ b/bundle/manifests/odf-operator.clusterserviceversion.yaml @@ -35,7 +35,7 @@ metadata: categories: Storage console.openshift.io/plugins: '["odf-console"]' containerImage: quay.io/ocs-dev/odf-operator:latest - createdAt: "2024-03-21T13:04:01Z" + createdAt: "2024-03-22T02:45:54Z" description: OpenShift Data Foundation provides a common control plane for storage solutions on OpenShift Container Platform. features.operators.openshift.io/token-auth-aws: "true" diff --git a/bundle/metadata/dependencies.yaml b/bundle/metadata/dependencies.yaml index 6fc6ac864..7ee50047f 100644 --- a/bundle/metadata/dependencies.yaml +++ b/bundle/metadata/dependencies.yaml @@ -7,6 +7,10 @@ dependencies: value: packageName: rook-ceph-operator version: ">=4.14.0 <4.15.0 || 4.15.0" +- type: olm.package + value: + packageName: ocs-client-operator + version: ">=4.14.0 <4.15.0 || 4.15.0" - type: olm.package value: packageName: noobaa-operator diff --git a/catalog/index.yaml b/catalog/index.yaml index ce8ef9530..56dab5a38 100644 --- a/catalog/index.yaml +++ b/catalog/index.yaml @@ -20,6 +20,17 @@ name: alpha entries: - name: ocs-operator.v4.15.0 +--- +defaultChannel: alpha +name: ocs-client-operator +schema: olm.package +--- +schema: olm.channel +package: ocs-client-operator +name: alpha +entries: + - name: ocs-client-operator.v4.15.0 + --- defaultChannel: alpha name: noobaa-operator diff --git a/config/manager/manager.env b/config/manager/manager.env index 687e32d13..92bca4c4e 100644 --- a/config/manager/manager.env +++ b/config/manager/manager.env @@ -16,6 +16,12 @@ OCS_SUBSCRIPTION_CHANNEL=alpha OCS_SUBSCRIPTION_STARTINGCSV=ocs-operator.v4.15.0 OCS_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace +OCS_CLIENT_SUBSCRIPTION_NAME=ocs-client-operator +OCS_CLIENT_SUBSCRIPTION_PACKAGE=ocs-client-operator +OCS_CLIENT_SUBSCRIPTION_CHANNEL=alpha +OCS_CLIENT_SUBSCRIPTION_STARTINGCSV=ocs-client-operator.v4.15.0 +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace IBM_SUBSCRIPTION_NAME=ibm-storage-odf-operator IBM_SUBSCRIPTION_PACKAGE=ibm-storage-odf-operator IBM_SUBSCRIPTION_CHANNEL=stable-v1.4 diff --git a/controllers/defaults.go b/controllers/defaults.go index 65c03bf29..afd778694 100644 --- a/controllers/defaults.go +++ b/controllers/defaults.go @@ -38,6 +38,13 @@ var ( "OCS_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource", "OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace", + "OCS_CLIENT_SUBSCRIPTION_NAME": "ocs-client-operator", + "OCS_CLIENT_SUBSCRIPTION_PACKAGE": "ocs-client-operator", + "OCS_CLIENT_SUBSCRIPTION_CHANNEL": "alpha", + "OCS_CLIENT_SUBSCRIPTION_STARTINGCSV": "ocs-client-operator.v4.15.0", + "OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource", + "OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace", + "CSIADDONS_SUBSCRIPTION_NAME": "csi-addons", "CSIADDONS_SUBSCRIPTION_PACKAGE": "csi-addons", "CSIADDONS_SUBSCRIPTION_CHANNEL": "alpha", @@ -76,6 +83,13 @@ var ( OcsSubscriptionCatalogSource = GetEnvOrDefault("OCS_SUBSCRIPTION_CATALOGSOURCE") OcsSubscriptionCatalogSourceNamespace = GetEnvOrDefault("OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE") + OcsClientSubscriptionName = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_NAME") + OcsClientSubscriptionPackage = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_PACKAGE") + OcsClientSubscriptionChannel = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_CHANNEL") + OcsClientSubscriptionStartingCSV = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_STARTINGCSV") + OcsClientSubscriptionCatalogSource = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE") + OcsClientSubscriptionCatalogSourceNamespace = GetEnvOrDefault("OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE") + NoobaaSubscriptionName = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_NAME") NoobaaSubscriptionPackage = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_PACKAGE") NoobaaSubscriptionChannel = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_CHANNEL") diff --git a/controllers/subscriptions.go b/controllers/subscriptions.go index 08b9b594b..e1b74275d 100644 --- a/controllers/subscriptions.go +++ b/controllers/subscriptions.go @@ -223,7 +223,8 @@ func GetVendorCsvNames(kind odfv1alpha1.StorageKind) []string { if kind == VendorFlashSystemCluster() { csvNames = []string{IbmSubscriptionStartingCSV} } else if kind == VendorStorageCluster() { - csvNames = []string{OcsSubscriptionStartingCSV, RookSubscriptionStartingCSV, NoobaaSubscriptionStartingCSV, CSIAddonsSubscriptionStartingCSV} + csvNames = []string{OcsSubscriptionStartingCSV, RookSubscriptionStartingCSV, NoobaaSubscriptionStartingCSV, + CSIAddonsSubscriptionStartingCSV, OcsClientSubscriptionStartingCSV} } return csvNames @@ -360,6 +361,21 @@ func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription { }, } + ocsClientSubscription := &operatorv1alpha1.Subscription{ + ObjectMeta: metav1.ObjectMeta{ + Name: OcsClientSubscriptionName, + Namespace: OperatorNamespace, + }, + Spec: &operatorv1alpha1.SubscriptionSpec{ + CatalogSource: OcsClientSubscriptionCatalogSource, + CatalogSourceNamespace: OcsClientSubscriptionCatalogSourceNamespace, + Package: OcsClientSubscriptionPackage, + Channel: OcsClientSubscriptionChannel, + StartingCSV: OcsClientSubscriptionStartingCSV, + InstallPlanApproval: operatorv1alpha1.ApprovalAutomatic, + }, + } + csiAddonsSubscription := &operatorv1alpha1.Subscription{ ObjectMeta: metav1.ObjectMeta{ Name: CSIAddonsSubscriptionName, @@ -415,7 +431,8 @@ func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription { }, } - return []*operatorv1alpha1.Subscription{ocsSubscription, rookSubscription, noobaaSubscription, csiAddonsSubscription, prometheusSubscription} + return []*operatorv1alpha1.Subscription{ocsSubscription, rookSubscription, noobaaSubscription, + csiAddonsSubscription, ocsClientSubscription, prometheusSubscription} } // GetFlashSystemClusterSubscription return subscription for FlashSystemCluster diff --git a/hack/make-bundle-vars.mk b/hack/make-bundle-vars.mk index f8724071d..f1922239a 100644 --- a/hack/make-bundle-vars.mk +++ b/hack/make-bundle-vars.mk @@ -73,6 +73,12 @@ OCS_BUNDLE_IMG_TAG ?= v4.15.0 OCS_BUNDLE_IMG_LOCATION ?= quay.io/ocs-dev OCS_BUNDLE_IMG ?= $(OCS_BUNDLE_IMG_LOCATION)/$(OCS_BUNDLE_IMG_NAME):$(OCS_BUNDLE_IMG_TAG) +OCS_CLIENT_BUNDLE_NAME ?= ocs-client-operator +OCS_CLIENT_BUNDLE_IMG_NAME ?= $(OCS_CLIENT_BUNDLE_NAME)-bundle +OCS_CLIENT_BUNDLE_IMG_TAG ?= v4.15.0 +OCS_CLIENT_BUNDLE_IMG_LOCATION ?= quay.io/ocs-dev +OCS_CLIENT_BUNDLE_IMG ?= $(OCS_CLIENT_BUNDLE_IMG_LOCATION)/$(OCS_CLIENT_BUNDLE_IMG_NAME):$(OCS_CLIENT_BUNDLE_IMG_TAG) + NOOBAA_BUNDLE_NAME ?= noobaa-operator NOOBAA_BUNDLE_IMG_NAME ?= $(NOOBAA_BUNDLE_NAME)-bundle NOOBAA_BUNDLE_IMG_TAG ?= v5.14.0 @@ -111,7 +117,7 @@ PROMETHEUS_BUNDLE_IMG ?= $(PROMETHEUS_BUNDLE_IMG_LOCATION)/$(PROMETHEUS_BUNDLE_I # A space-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0 example.com/operator-bundle:v0.2.0). # These images MUST exist in a registry and be pull-able. -BUNDLE_IMGS ?= $(BUNDLE_IMG) $(OCS_BUNDLE_IMG) $(IBM_BUNDLE_IMG) $(NOOBAA_BUNDLE_IMG) $(CSIADDONS_BUNDLE_IMG) $(ROOK_BUNDLE_IMG) +BUNDLE_IMGS ?= $(BUNDLE_IMG) $(OCS_BUNDLE_IMG) $(OCS_CLIENT_BUNDLE_IMG) $(IBM_BUNDLE_IMG) $(NOOBAA_BUNDLE_IMG) $(CSIADDONS_BUNDLE_IMG) $(ROOK_BUNDLE_IMG) # Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. ifneq ($(origin CATALOG_BASE_IMG), undefined) @@ -144,6 +150,13 @@ OCS_SUBSCRIPTION_STARTINGCSV ?= $(OCS_BUNDLE_NAME).$(OCS_BUNDLE_IMG_TAG) OCS_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE) OCS_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE) +OCS_CLIENT_SUBSCRIPTION_NAME ?= $(OCS_CLIENT_BUNDLE_NAME) +OCS_CLIENT_SUBSCRIPTION_PACKAGE ?= $(OCS_CLIENT_BUNDLE_NAME) +OCS_CLIENT_SUBSCRIPTION_CHANNEL ?= $(DEFAULT_CHANNEL) +OCS_CLIENT_SUBSCRIPTION_STARTINGCSV ?= $(OCS_CLIENT_BUNDLE_NAME).$(OCS_CLIENT_BUNDLE_IMG_TAG) +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE) +OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE) + IBM_SUBSCRIPTION_NAME ?= $(IBM_BUNDLE_NAME) IBM_SUBSCRIPTION_PACKAGE ?= $(IBM_BUNDLE_NAME) IBM_SUBSCRIPTION_CHANNEL ?= stable-v1.4 From 461b72bde879d9e46f82ef1d49c4adb5654937ae Mon Sep 17 00:00:00 2001 From: Leela Venkaiah G Date: Fri, 22 Mar 2024 10:05:11 +0530 Subject: [PATCH 2/2] ci: update e2e tests to include ocs-client subscription Update e2e tests for deploying ocs-client subscription and csv while installing odf-operator Signed-off-by: Leela Venkaiah G --- e2e/config.go | 9 ++++++++- hack/e2e-test.sh | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/e2e/config.go b/e2e/config.go index 8ffd9a5ff..24c1f1b71 100644 --- a/e2e/config.go +++ b/e2e/config.go @@ -20,6 +20,8 @@ var ( OdfClusterServiceVersion string // OcsClusterServiceVersion is the name of ocs csv OcsClusterServiceVersion string + // OcsClientClusterServiceVersion is the name of ocs-client csv + OcsClientClusterServiceVersion string // NoobaClusterServiceVersion is the name of Nooba csv NoobaClusterServiceVersion string // CsiaddonsClusterServiceVersion is the name of Csiaddons csv @@ -48,6 +50,7 @@ func init() { flag.BoolVar(&OdfClusterUninstall, "odf-operator-uninstall", true, "Uninstall the ODF operator after test completion") flag.StringVar(&OdfClusterServiceVersion, "odf-cluster-service-version", "", "The ODF CSV name which needs to verified") flag.StringVar(&OcsClusterServiceVersion, "ocs-cluster-service-version", "", "The OCS CSV name which needs to verified") + flag.StringVar(&OcsClientClusterServiceVersion, "ocs-client-cluster-service-version", "", "The OCS CSV name which needs to verified") flag.StringVar(&NoobaClusterServiceVersion, "nooba-cluster-service-version", "", "The Nooba CSV name which needs to verified") flag.StringVar(&CsiaddonsClusterServiceVersion, "csiaddons-cluster-service-version", "", "The CSI Addon CSV name which needs to verified") flag.StringVar(&RookClusterServiceVersion, "rook-cluster-service-version", "", "The Rook CSV name which needs to verified") @@ -57,7 +60,7 @@ func init() { verifyFlags() // A list of names of all the csvs that should be installed - CsvNames = []string{OdfClusterServiceVersion, OcsClusterServiceVersion, + CsvNames = []string{OdfClusterServiceVersion, OcsClusterServiceVersion, OcsClientClusterServiceVersion, RookClusterServiceVersion, NoobaClusterServiceVersion, CsiaddonsClusterServiceVersion, PrometheusClusterServiceVersion} @@ -86,6 +89,10 @@ func verifyFlags() { panic("ocs-cluster-service-version is not provided") } + if OcsClientClusterServiceVersion == "" { + panic("ocs-client-cluster-service-version is not provider") + } + if NoobaClusterServiceVersion == "" { panic("nooba-cluster-service-version is not provided") } diff --git a/hack/e2e-test.sh b/hack/e2e-test.sh index 11df4f243..b52142a13 100755 --- a/hack/e2e-test.sh +++ b/hack/e2e-test.sh @@ -9,6 +9,7 @@ cd e2e/odf && ${GINKGO} build && ./odf.test \ --odf-operator-uninstall=${ODF_OPERATOR_UNINSTALL} \ --odf-cluster-service-version=odf-operator.v${VERSION} \ --ocs-cluster-service-version=${OCS_SUBSCRIPTION_STARTINGCSV} \ + --ocs-client-cluster-service-version=${OCS_CLIENT_SUBSCRIPTION_STARTINGCSV} \ --nooba-cluster-service-version=${NOOBAA_SUBSCRIPTION_STARTINGCSV} \ --csiaddons-cluster-service-version=${CSIADDONS_SUBSCRIPTION_STARTINGCSV} \ --rook-cluster-service-version=${ROOK_SUBSCRIPTION_STARTINGCSV} \