diff --git a/Documentation/ceph-csi-drivers.md b/Documentation/ceph-csi-drivers.md index 75c733864..91b2a6f2a 100644 --- a/Documentation/ceph-csi-drivers.md +++ b/Documentation/ceph-csi-drivers.md @@ -89,8 +89,8 @@ Kubernetes version 1.21 or greater is required. 1. Install the volume replication CRDs: ```console -kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml -kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml +kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.3.0/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml +kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.3.0/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml ``` 2. Enable the volume replication controller: diff --git a/Documentation/rbd-mirroring.md b/Documentation/rbd-mirroring.md index 1e1c3ba3b..b43da2d6d 100644 --- a/Documentation/rbd-mirroring.md +++ b/Documentation/rbd-mirroring.md @@ -188,9 +188,9 @@ APIs for storage disaster recovery. The extended APIs are provided via Custom Resource Definition(CRD). Create the VolumeReplication CRDs on all the peer clusters. ```bash -$ kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml +$ kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.3.0/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml -$ kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml +$ kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.3.0/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml ``` ## Enable CSI Replication Sidecars diff --git a/build/crds/build-crds.sh b/build/crds/build-crds.sh index 06c652a8c..bc4281813 100755 --- a/build/crds/build-crds.sh +++ b/build/crds/build-crds.sh @@ -51,6 +51,21 @@ copy_ob_obc_crds() { cp -f "${SCRIPT_ROOT}/deploy/olm/assemble/objectbucket.io_objectbuckets.yaml" "$OLM_CATALOG_DIR" } +copy_volume_replication_crds() { + volume_replication_dir=${SCRIPT_ROOT}/.cache/crds/volumereplication + volume_replication_crd=replication.storage.openshift.io_volumereplications.yaml + volume_replication_class_crd=replication.storage.openshift.io_volumereplicationclasses.yaml + if [[ ! -d "${volume_replication_dir}" ]]; then + mkdir -p "${volume_replication_dir}" + VOLUME_REPLICATION_URL=${VOLUME_REPLICATION_URL:-https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.3.0/config/crd/bases} + curl -L ${VOLUME_REPLICATION_URL}/${volume_replication_crd} -o ${volume_replication_dir}/${volume_replication_crd} + curl -L ${VOLUME_REPLICATION_URL}/${volume_replication_class_crd} -o ${volume_replication_dir}/${volume_replication_class_crd} + fi + + cp -f "${volume_replication_dir}/${volume_replication_crd}" "$OLM_CATALOG_DIR" + cp -f "${volume_replication_dir}/${volume_replication_class_crd}" "$OLM_CATALOG_DIR" +} + generating_crds_v1() { echo "Generating ceph crds" "$CONTROLLER_GEN_BIN_PATH" "$CRD_OPTIONS" paths="./pkg/apis/ceph.rook.io/v1" output:crd:artifacts:config="$OLM_CATALOG_DIR" @@ -106,3 +121,7 @@ echo "---" >> "$CEPH_CRDS_FILE_PATH" # yq doesn't output the first doc separator $YQ_BIN_PATH eval-all '.' "${CRD_FILES[@]}" >> "$CEPH_CRDS_FILE_PATH" build_helm_resources + +# copy the volume replication crds last so they won't be included in the helm chart or crds.yaml, +# we just want them to end up owned by the csv +copy_volume_replication_crds diff --git a/images/ceph/Makefile b/images/ceph/Makefile index 3355b470d..6e3738c4d 100755 --- a/images/ceph/Makefile +++ b/images/ceph/Makefile @@ -59,11 +59,6 @@ endif # s5cmd's version S5CMD_VERSION = 1.4.0 -VOL_REPL_VERSION = v0.1.0 -VOL_REPL_URL = https://raw.githubusercontent.com/csi-addons/volume-replication-operator/$(VOL_REPL_VERSION)/config/crd/bases -VOLUME_REPLICATION_CRD = replication.storage.openshift.io_volumereplications.yaml -VOLUME_REPLICATION_CLASS_CRD = replication.storage.openshift.io_volumereplicationclasses.yaml - OPERATOR_SDK := $(TOOLS_HOST_DIR)/operator-sdk-$(OPERATOR_SDK_VERSION) YQv3 := $(TOOLS_HOST_DIR)/yq-$(YQv3_VERSION) export OPERATOR_SDK YQv3 @@ -84,8 +79,6 @@ do.build: ifeq ($(INCLUDE_CSV_TEMPLATES),true) @$(MAKE) CSV_TEMPLATE_DIR=$(TEMP) generate-csv-templates - @$(MAKE) get-volume-replication-crds - cp $(CACHE_DIR)/crds/* $(TEMP)/deploy/olm/templates/crds/. @cp -r $(TEMP)/deploy/olm/templates $(TEMP)/ceph-csv-templates else mkdir $(TEMP)/ceph-csv-templates @@ -102,7 +95,7 @@ endif # call this before building multiple arches in parallel to prevent parallel build processes from # conflicting -prerequisites: $(OPERATOR_SDK) $(YQv3) get-volume-replication-crds +prerequisites: $(OPERATOR_SDK) $(YQv3) # generate CSV template files into the directory defined by the env var CSV_TEMPLATE_DIR # CSV_TEMPLATE_DIR will be created if it doesn't already exist @@ -126,13 +119,6 @@ generate-csv-templates: $(OPERATOR_SDK) $(YQv3) ## Generate CSV templates for OL @OLM_CATALOG_DIR=$(CSV_TEMPLATE_DIR)/deploy/olm ../../deploy/olm/generate-rook-csv-templates.sh @echo " === Generated CSV templates can be found at $(CSV_TEMPLATE_DIR)/deploy/olm/templates" -get-volume-replication-crds: - if [[ ! -d "$(CACHE_DIR)/crds" ]]; then\ - mkdir -p $(CACHE_DIR)/crds;\ - curl -L $(VOL_REPL_URL)/$(VOLUME_REPLICATION_CRD) -o $(CACHE_DIR)/crds/$(VOLUME_REPLICATION_CRD);\ - curl -L $(VOL_REPL_URL)/$(VOLUME_REPLICATION_CLASS_CRD) -o $(CACHE_DIR)/crds/$(VOLUME_REPLICATION_CLASS_CRD);\ - fi - $(YQv3): @echo === installing yq $(YQv3_VERSION) $(REAL_HOST_PLATFORM) @mkdir -p $(TOOLS_HOST_DIR) diff --git a/tests/framework/installer/ceph_installer.go b/tests/framework/installer/ceph_installer.go index 6de61970e..5105d54a3 100644 --- a/tests/framework/installer/ceph_installer.go +++ b/tests/framework/installer/ceph_installer.go @@ -59,7 +59,7 @@ const ( osd_pool_default_size = 1 bdev_flock_retry = 20 ` - volumeReplicationVersion = "v0.1.0" + volumeReplicationVersion = "v0.3.0" ) var ( diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 972ef3371..0b8c0bffe 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -166,7 +166,7 @@ function validate_yaml() { kubectl create -f crds.yaml -f common.yaml # create the volume replication CRDs - replication_version=v0.1.0 + replication_version=v0.3.0 replication_url="https://raw.githubusercontent.com/csi-addons/volume-replication-operator/${replication_version}/config/crd/bases" kubectl create -f "${replication_url}/replication.storage.openshift.io_volumereplications.yaml" kubectl create -f "${replication_url}/replication.storage.openshift.io_volumereplicationclasses.yaml"