Skip to content

Commit

Permalink
bundle: added new rook subscription
Browse files Browse the repository at this point in the history
Added rook-ceph-operator subscription to odf-operator
Also, updated the odf-catalogsource to include rook-ceph-operator
bundle in it.

Signed-off-by: Nikhil-Ladha <[email protected]>
  • Loading branch information
Nikhil-Ladha committed Mar 12, 2024
1 parent 9a4efc9 commit 07e0d8b
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ catalog/ibm.yaml
catalog/noobaa.yaml
catalog/ocs.yaml
catalog/odf.yaml
catalog/rook.yaml
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/odf-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions catalog/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions config/manager/manager.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 (
Expand Down
29 changes: 27 additions & 2 deletions controllers/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion hack/make-bundle-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 07e0d8b

Please sign in to comment.