Skip to content

Commit

Permalink
Add ocs-client bundle to ocs-operator catalog
Browse files Browse the repository at this point in the history
Update relevant script files to inclue the ocs-client bundle image name
and ocs-client bundle deployment script

Signed-off-by: Leela Venkaiah G <[email protected]>
  • Loading branch information
leelavg committed Mar 22, 2024
1 parent cc415e7 commit f64f6a3
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ bin
catalog/ocs-bundle.yaml
catalog/noobaa-bundle.yaml
catalog/rook-ceph-bundle.yaml
catalog/ocs-client-bundle.yaml

tools/csv-merger/csv-merger
tools/csv-checksum/csv-checksum
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ install-ocs: operator-sdk
@echo "Installing ocs operator"
hack/install-ocs.sh

install-ocs-client: operator-sdk
@echo "Installing ocs-client operator"
hack/install-ocs-client.sh

install-rook: operator-sdk
@echo "Installing rook-ceph operator"
hack/install-rook.sh
11 changes: 11 additions & 0 deletions catalog/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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: rook-ceph-operator
Expand Down
11 changes: 11 additions & 0 deletions deploy/deploy-with-olm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ spec:
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: ocs-client-subscription
namespace: openshift-storage
spec:
channel: alpha
name: ocs-client-operator
source: ocs-catalogsource
sourceNamespace: openshift-marketplace
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: rook-subscription
namespace: openshift-storage
Expand Down
1 change: 1 addition & 0 deletions hack/build-operator-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ echo "Did you push the bundle image? It must be pullable from '$IMAGE_REGISTRY'.
echo "Run '${IMAGE_BUILD_CMD} push ${BUNDLE_FULL_IMAGE_NAME}'"
echo
${OPM} render --output=yaml "${BUNDLE_FULL_IMAGE_NAME}" > catalog/ocs-bundle.yaml
${OPM} render --output=yaml "${OCS_CLIENT_BUNDLE_FULL_IMAGE_NAME}" > catalog/ocs-client-bundle.yaml
${OPM} render --output=yaml ${NOOBAA_BUNDLE_FULL_IMAGE_NAME} > catalog/noobaa-bundle.yaml
${OPM} render --output=yaml ${ROOK_BUNDLE_FULL_IMAGE_NAME} > catalog/rook-ceph-bundle.yaml
${OPM} validate catalog
Expand Down
2 changes: 2 additions & 0 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ FILE_BASED_CATALOG_FULL_IMAGE_NAME="${FILE_BASED_CATALOG_FULL_IMAGE_NAME:-${DEFA
METRICS_EXPORTER_FULL_IMAGE_NAME="${METRICS_EXPORTER_FULL_IMAGE_NAME:-${DEFAULT_METRICS_EXPORTER_FULL_IMAGE_NAME}}"
UX_BACKEND_OAUTH_FULL_IMAGE_NAME="${UX_BACKEND_OAUTH_FULL_IMAGE_NAME:-${DEFAULT_UX_BACKEND_OAUTH_FULL_IMAGE_NAME}}"

CSI_ADDONS_CATALOG_FULL_IMAGE_NAME="quay.io/ocs-dev/csi-addons-catalog:v0.7.0"
OCS_CLIENT_BUNDLE_FULL_IMAGE_NAME="quay.io/ocs-dev/ocs-client-operator-bundle:v4.15.0"
NOOBAA_BUNDLE_FULL_IMAGE_NAME="quay.io/noobaa/noobaa-operator-bundle:master-20231217"
ROOK_BUNDLE_FULL_IMAGE_NAME="quay.io/ocs-dev/rook-ceph-operator-bundle:latest"

Expand Down
19 changes: 19 additions & 0 deletions hack/install-ocs-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

source hack/common.sh

NAMESPACE=$(oc get ns "$INSTALL_NAMESPACE" -o jsonpath="{.metadata.name}" 2>/dev/null || true)
if [[ -n "$NAMESPACE" ]]; then
echo "Namespace \"$NAMESPACE\" exists"
else
echo "Namespace \"$INSTALL_NAMESPACE\" does not exist: creating it"
oc create ns "$INSTALL_NAMESPACE"
fi

"$OPERATOR_SDK" run bundle "$OCS_CLIENT_BUNDLE_FULL_IMAGE_NAME" --timeout=10m --security-context-config restricted -n "$INSTALL_NAMESPACE" --index-image "$CSI_ADDONS_CATALOG_FULL_IMAGE_NAME"

oc wait --timeout=5m --for condition=Available -n "$INSTALL_NAMESPACE" deployment ocs-client-operator-controller-manager
16 changes: 15 additions & 1 deletion pkg/deploy-manager/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ func (t *DeployManager) generateClusterObjects(ocsCatalogImage string, subscript
}
ocsSubscription.SetGroupVersionKind(schema.GroupVersionKind{Group: v1alpha1.SchemeGroupVersion.Group, Kind: "Subscription", Version: v1alpha1.SchemeGroupVersion.Version})

ocsClientSubscription := v1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: "ocs-client-subscription",
Namespace: InstallNamespace,
},
Spec: &v1alpha1.SubscriptionSpec{
Channel: subscriptionChannel,
Package: "ocs-client-operator",
CatalogSource: "ocs-catalogsource",
CatalogSourceNamespace: marketplaceNamespace,
},
}
ocsClientSubscription.SetGroupVersionKind(schema.GroupVersionKind{Group: v1alpha1.SchemeGroupVersion.Group, Kind: "Subscription", Version: v1alpha1.SchemeGroupVersion.Version})

rookSubscription := v1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: "rook-subscription",
Expand Down Expand Up @@ -191,7 +205,7 @@ func (t *DeployManager) generateClusterObjects(ocsCatalogImage string, subscript
}
noobaSubscription.SetGroupVersionKind(schema.GroupVersionKind{Group: v1alpha1.SchemeGroupVersion.Group, Kind: "Subscription", Version: v1alpha1.SchemeGroupVersion.Version})

co.subscriptions = append(co.subscriptions, ocsSubscription, rookSubscription, noobaSubscription)
co.subscriptions = append(co.subscriptions, ocsSubscription, ocsClientSubscription, rookSubscription, noobaSubscription)

return co
}
Expand Down

0 comments on commit f64f6a3

Please sign in to comment.