diff --git a/.gitignore b/.gitignore index 209d17b9c..e71fa3387 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ catalog/ibm.yaml catalog/noobaa.yaml catalog/ocs.yaml catalog/odf.yaml +catalog/rook.yaml diff --git a/Makefile b/Makefile index 071303230..a32071cb4 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,12 @@ IBM_SUBSCRIPTION_CHANNEL=$(IBM_SUBSCRIPTION_CHANNEL) IBM_SUBSCRIPTION_STARTINGCSV=$(IBM_SUBSCRIPTION_STARTINGCSV) IBM_SUBSCRIPTION_CATALOGSOURCE=$(IBM_SUBSCRIPTION_CATALOGSOURCE) IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE) +ROOK_SUBSCRIPTION_NAME=$(ROOK_SUBSCRIPTION_NAME) +ROOK_SUBSCRIPTION_PACKAGE=$(ROOK_SUBSCRIPTION_PACKAGE) +ROOK_SUBSCRIPTION_CHANNEL=$(ROOK_SUBSCRIPTION_CHANNEL) +ROOK_SUBSCRIPTION_STARTINGCSV=$(ROOK_SUBSCRIPTION_STARTINGCSV) +ROOK_SUBSCRIPTION_CATALOGSOURCE=$(ROOK_SUBSCRIPTION_CATALOGSOURCE) +ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=$(ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE) endef export MANAGER_ENV_VARS @@ -168,6 +174,7 @@ catalog: opm ## Generate catalog manifests and then validate generated files. $(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 + $(OPM) render --output=yaml $(ROOK_BUNDLE_IMG) $(OPM_RENDER_OPTS) > catalog/rook.yaml $(OPM) validate catalog .PHONY: catalog-build diff --git a/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml b/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml index d30203bf8..623696194 100644 --- a/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml +++ b/bundle/manifests/odf-operator-manager-config_v1_configmap.yaml @@ -24,6 +24,12 @@ data: OCS_SUBSCRIPTION_NAME: ocs-operator OCS_SUBSCRIPTION_PACKAGE: ocs-operator OCS_SUBSCRIPTION_STARTINGCSV: ocs-operator.v4.15.0 + ROOK_SUBSCRIPTION_CATALOGSOURCE: odf-catalogsource + ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace + ROOK_SUBSCRIPTION_CHANNEL: alpha + ROOK_SUBSCRIPTION_NAME: rook-ceph-operator + ROOK_SUBSCRIPTION_PACKAGE: rook-ceph-operator + ROOK_SUBSCRIPTION_STARTINGCSV: rook-ceph-operator.latest controller_manager_config.yaml: | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 kind: ControllerManagerConfig diff --git a/bundle/manifests/odf-operator.clusterserviceversion.yaml b/bundle/manifests/odf-operator.clusterserviceversion.yaml index 678cc2bde..dd48bc20e 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-02-09T04:53:49Z" + createdAt: "2024-03-12T11:51:56Z" 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/catalog/index.yaml b/catalog/index.yaml index 1f6d49220..60a4722c2 100644 --- a/catalog/index.yaml +++ b/catalog/index.yaml @@ -52,3 +52,14 @@ package: ibm-storage-odf-operator name: stable-v1.4 entries: - name: ibm-storage-odf-operator.v1.4.1 + +--- +defaultChannel: alpha +name: rook-ceph-operator +schema: olm.package +--- +schema: olm.channel +package: rook-ceph-operator +name: alpha +entries: + - name: rook-ceph-operator.v4.15.0 diff --git a/config/manager/manager.env b/config/manager/manager.env index a269be4bd..c6d954e62 100644 --- a/config/manager/manager.env +++ b/config/manager/manager.env @@ -22,3 +22,9 @@ IBM_SUBSCRIPTION_CHANNEL=stable-v1.4 IBM_SUBSCRIPTION_STARTINGCSV=ibm-storage-odf-operator.v1.4.1 IBM_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace +ROOK_SUBSCRIPTION_NAME=rook-ceph-operator +ROOK_SUBSCRIPTION_PACKAGE=rook-ceph-operator +ROOK_SUBSCRIPTION_CHANNEL=alpha +ROOK_SUBSCRIPTION_STARTINGCSV=rook-ceph-operator.latest +ROOK_SUBSCRIPTION_CATALOGSOURCE=odf-catalogsource +ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE=openshift-marketplace diff --git a/controllers/defaults.go b/controllers/defaults.go index 8c5100214..36794183f 100644 --- a/controllers/defaults.go +++ b/controllers/defaults.go @@ -51,6 +51,13 @@ var ( "IBM_SUBSCRIPTION_STARTINGCSV": "ibm-storage-odf-operator.v1.4.1", "IBM_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource", "IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace", + + "ROOK_SUBSCRIPTION_NAME": "rook-ceph-operator", + "ROOK_SUBSCRIPTION_PACKAGE": "rook-ceph-operator", + "ROOK_SUBSCRIPTION_CHANNEL": "alpha", + "ROOK_SUBSCRIPTION_STARTINGCSV": "rook-ceph-operator.v1.4.1", + "ROOK_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource", + "ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace", } OperatorNamespace = GetEnvOrDefault("OPERATOR_NAMESPACE") @@ -82,6 +89,13 @@ var ( IbmSubscriptionStartingCSV = GetEnvOrDefault("IBM_SUBSCRIPTION_STARTINGCSV") IbmSubscriptionCatalogSource = GetEnvOrDefault("IBM_SUBSCRIPTION_CATALOGSOURCE") IbmSubscriptionCatalogSourceNamespace = GetEnvOrDefault("IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE") + + RookSubscriptionName = GetEnvOrDefault("ROOK_SUBSCRIPTION_NAME") + RookSubscriptionPackage = GetEnvOrDefault("ROOK_SUBSCRIPTION_PACKAGE") + RookSubscriptionChannel = GetEnvOrDefault("ROOK_SUBSCRIPTION_CHANNEL") + RookSubscriptionStartingCSV = GetEnvOrDefault("ROOK_SUBSCRIPTION_STARTINGCSV") + RookSubscriptionCatalogSource = GetEnvOrDefault("ROOK_SUBSCRIPTION_CATALOGSOURCE") + RookSubscriptionCatalogSourceNamespace = GetEnvOrDefault("ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE") ) const ( diff --git a/controllers/subscriptions.go b/controllers/subscriptions.go index f3a31752c..98a7cf016 100644 --- a/controllers/subscriptions.go +++ b/controllers/subscriptions.go @@ -223,7 +223,7 @@ func GetVendorCsvNames(kind odfv1alpha1.StorageKind) []string { if kind == VendorFlashSystemCluster() { csvNames = []string{IbmSubscriptionStartingCSV} } else if kind == VendorStorageCluster() { - csvNames = []string{NoobaaSubscriptionStartingCSV, OcsSubscriptionStartingCSV, CSIAddonsSubscriptionStartingCSV} + csvNames = []string{NoobaaSubscriptionStartingCSV, OcsSubscriptionStartingCSV, CSIAddonsSubscriptionStartingCSV, RookSubscriptionStartingCSV} } return csvNames @@ -385,7 +385,32 @@ func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription { }, } - return []*operatorv1alpha1.Subscription{noobaaSubscription, ocsSubscription, csiAddonsSubscription} + rookSubscription := &operatorv1alpha1.Subscription{ + ObjectMeta: metav1.ObjectMeta{ + Name: RookSubscriptionName, + Namespace: OperatorNamespace, + }, + Spec: &operatorv1alpha1.SubscriptionSpec{ + CatalogSource: RookSubscriptionCatalogSource, + CatalogSourceNamespace: RookSubscriptionCatalogSourceNamespace, + Package: RookSubscriptionPackage, + Channel: RookSubscriptionChannel, + StartingCSV: RookSubscriptionStartingCSV, + InstallPlanApproval: operatorv1alpha1.ApprovalAutomatic, + Config: &operatorv1alpha1.SubscriptionConfig{ + Tolerations: []corev1.Toleration{ + { + Key: "node.ocs.openshift.io/storage", + Operator: "Equal", + Value: "true", + Effect: "NoSchedule", + }, + }, + }, + }, + } + + return []*operatorv1alpha1.Subscription{noobaaSubscription, ocsSubscription, csiAddonsSubscription, rookSubscription} } // GetFlashSystemClusterSubscription return subscription for FlashSystemCluster diff --git a/hack/make-bundle-vars.mk b/hack/make-bundle-vars.mk index 91f36c55f..6ccce8852 100644 --- a/hack/make-bundle-vars.mk +++ b/hack/make-bundle-vars.mk @@ -96,9 +96,15 @@ ODF_CONSOLE_IMG_TAG ?= latest ODF_CONSOLE_IMG_LOCATION ?= quay.io/ocs-dev ODF_CONSOLE_IMG ?= $(ODF_CONSOLE_IMG_LOCATION)/$(ODF_CONSOLE_IMG_NAME):$(ODF_CONSOLE_IMG_TAG) +ROOK_BUNDLE_NAME ?= rook-ceph-operator +ROOK_BUNDLE_IMG_NAME ?= $(ROOK_BUNDLE_NAME)-bundle +ROOK_BUNDLE_IMG_TAG ?= latest +ROOK_BUNDLE_IMG_LOCATION ?= quay.io/ocs-dev +ROOK_BUNDLE_IMG ?= $(ROOK_BUNDLE_IMG_LOCATION)/$(ROOK_BUNDLE_IMG_NAME):$(ROOK_BUNDLE_IMG_TAG) + # 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) +BUNDLE_IMGS ?= $(BUNDLE_IMG) $(OCS_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) @@ -138,6 +144,13 @@ IBM_SUBSCRIPTION_STARTINGCSV ?= $(IBM_BUNDLE_NAME).v$(IBM_BUNDLE_IMG_TAG) IBM_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE) IBM_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE) +ROOK_SUBSCRIPTION_NAME ?= $(ROOK_BUNDLE_NAME) +ROOK_SUBSCRIPTION_PACKAGE ?= $(ROOK_BUNDLE_NAME) +ROOK_SUBSCRIPTION_CHANNEL ?= $(DEFAULT_CHANNEL) +ROOK_SUBSCRIPTION_STARTINGCSV ?= $(ROOK_BUNDLE_NAME).$(ROOK_BUNDLE_IMG_TAG) +ROOK_SUBSCRIPTION_CATALOGSOURCE ?= $(OPERATOR_CATALOGSOURCE) +ROOK_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE ?= $(OPERATOR_CATALOGSOURCE_NAMESPACE) + # kube rbac proxy image variables CLUSTER_ENV ?= openshift KUBE_RBAC_PROXY_IMG ?= gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1