Skip to content

Commit

Permalink
external: add a new configmap to store external cluster script
Browse files Browse the repository at this point in the history
add a new static configmap to store the external cluster script
and ship it as part of the rook bundle

Signed-off-by: Nikhil-Ladha <[email protected]>
  • Loading branch information
Nikhil-Ladha committed Sep 13, 2024
1 parent e6f21bc commit 3d06aee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/csv/csv-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ YQ_CMD_MERGE_OVERWRITE=("$yq" merge --inplace --overwrite --prettyPrint)
YQ_CMD_MERGE=("$yq" merge --arrays=append --inplace)
YQ_CMD_WRITE=("$yq" write --inplace -P)
CSV_FILE_NAME="../../build/csv/ceph/$PLATFORM/manifests/rook-ceph-operator.clusterserviceversion.yaml"
EXTERNAL_CLUSTER_SCRIPT_CONFIGMAP="../../build/csv/ceph/$PLATFORM/manifests/rook-ceph-external-cluster-script-config_v1_configmap.yaml"
CEPH_EXTERNAL_SCRIPT_FILE="../../deploy/examples/create-external-cluster-resources.py"
ASSEMBLE_FILE_COMMON="../../deploy/olm/assemble/metadata-common.yaml"
ASSEMBLE_FILE_OCP="../../deploy/olm/assemble/metadata-ocp.yaml"
Expand Down Expand Up @@ -66,6 +67,9 @@ function generate_csv() {
# We don't need to include these files in csv as ocs-operator creates its own.
rm -rf "../../build/csv/ceph/$PLATFORM/manifests/rook-ceph-operator-config_v1_configmap.yaml"

# Update the "create-external-resources.py" script value in external-cluster-script-configmap
"${YQ_CMD_WRITE[@]}" "$EXTERNAL_CLUSTER_SCRIPT_CONFIGMAP" data.script "$(base64 <$CEPH_EXTERNAL_SCRIPT_FILE)"

# This change are just to make the CSV file as it was earlier and as ocs-operator reads.
# Skipping this change for darwin since `sed -i` doesn't work with darwin properly.
# and the csv is not ever needed in the mac builds.
Expand Down
9 changes: 9 additions & 0 deletions deploy/examples/external-cluster-script-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
# The below field will contain the "create-external-cluster-resources.py" script.
# Use the updated configmap with the base64 encoded script value stored under
# build/csv/ceph directory.
script: ""
kind: ConfigMap
metadata:
name: rook-ceph-external-cluster-script-config
1 change: 1 addition & 0 deletions deploy/examples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ resources:
- common.yaml
- operator-openshift.yaml
- csi/nfs/rbac.yaml
- external-cluster-script-configmap.yaml

0 comments on commit 3d06aee

Please sign in to comment.