Merge pull request #9851 from travisn/replication-csv

build: Add volume replication crds to csv ownership
This commit is contained in:
Travis Nielsen authored and GitHub committed 2022-03-10 07:40:52 -07:00
commit 2e27ca883f
6 files changed
+26 -21

No files matched your search

+2 -2
View File
@@ -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:
+2 -2
View File
@@ -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
+19
View File
@@ -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
+1 -15
View File
@@ -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)
+1 -1
View File
@@ -59,7 +59,7 @@ const (
osd_pool_default_size = 1
bdev_flock_retry = 20
`
volumeReplicationVersion = "v0.1.0"
volumeReplicationVersion = "v0.3.0"
)
var (
+1 -1
View File
@@ -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"