Merge pull request #11281 from subhamkrai/update-operator-sdk

core: upgrade to latest operator-sdk v1.25.0
This commit is contained in:
Blaine Gardner authored and GitHub committed 2023-02-13 09:33:32 -07:00
commit 76528305f0
9 files changed
+90 -353

No files matched your search

+3 -3
View File
@@ -178,9 +178,9 @@ prune: ## Prune cached artifacts.
@$(MAKE) -C images prune
# Change how CRDs are generated for CSVs
csv-ceph: export MAX_DESC_LEN=0 # sets the description length to 0 since CSV cannot be bigger than 1MB
csv-ceph: export NO_OB_OBC_VOL_GEN=true
csv-ceph: csv-clean crds ## Generate a CSV file for OLM.
csv: export MAX_DESC_LEN=0 # sets the description length to 0 since CSV cannot be bigger than 1MB
csv: export NO_OB_OBC_VOL_GEN=true
csv: csv-clean crds ## Generate a CSV file for OLM.
$(MAKE) -C images/ceph csv
csv-clean: ## Remove existing OLM files.
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -e
#############
# VARIABLES #
#############
operator_sdk="${OPERATOR_SDK:-operator-sdk}"
yq="${YQv3:-yq}"
PLATFORM=$(go env GOARCH)
YQ_CMD_DELETE=("$yq" delete -i)
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/ceph.clusterserviceversion.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"
#############
# FUNCTIONS #
#############
function generate_csv() {
kubectl kustomize ../../deploy/examples/ | "$operator_sdk" generate bundle --package="ceph" --output-dir="../../build/csv/ceph/$PLATFORM" --extra-service-accounts=rook-ceph-system,rook-csi-rbd-provisioner-sa,rook-csi-rbd-plugin-sa,rook-csi-cephfs-provisioner-sa,rook-csi-nfs-provisioner-sa,rook-csi-nfs-plugin-sa,rook-csi-cephfs-plugin-sa,rook-ceph-system,rook-ceph-rgw,rook-ceph-purge-osd,rook-ceph-osd,rook-ceph-mgr,rook-ceph-cmd-reporter
# cleanup to get the expected state before merging the real data from assembles
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.icon[*]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.installModes[*]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.keywords[0]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.maintainers[0]'
"${YQ_CMD_MERGE_OVERWRITE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_COMMON"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.annotations.externalClusterScript "$(base64 <$CEPH_EXTERNAL_SCRIPT_FILE)"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.name "rook-ceph.v${VERSION}"
"${YQ_CMD_MERGE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_OCP"
mv "$CSV_FILE_NAME" "../../build/csv/"
}
generate_csv
+8
View File
@@ -0,0 +1,8 @@
# Adds namespace to all resources.
namespace: rook-ceph
resources:
- crds.yaml
- common.yaml
- operator-openshift.yaml
- csi/nfs/rbac.yaml
-24
View File
@@ -1,24 +0,0 @@
# Build Rook's CSV file
Just run `make CSV_VERSION=1.0.0 csv-ceph` like this:
```console
make csv-ceph CSV_VERSION=1.0.1 CSV_PLATFORM=k8s ROOK_OP_VERSION=rook/ceph:v1.0.1
```
> ```
> INFO[0000] Generating CSV manifest version 1.0.1
> INFO[0000] Fill in the following required fields in file deploy/olm-catalog/ceph.csv.yaml:
> spec.keywords
> spec.maintainers
> spec.provider
> spec.labels
> INFO[0000] Create deploy/olm-catalog/ceph.csv.yaml
> INFO[0000] Create deploy/olm-catalog/_generated.concat_crd.yaml
>
> Congratulations!
> Your Rook CSV 1.0.1 file for k8s is ready at: deploy/olm/deploy/olm-catalog/rook-ceph.v1.0.1.clusterserviceversion.yaml
> Push it to https://github.com/operator-framework/community-operators as well as the CRDs files from deploy/olm/deploy/crds and the package file deploy/olm/assemble/rook-ceph.package.yaml.
> ```
Or for OpenShift use: `make CSV_VERSION=1.0.0 CSV_PLATFORM=ocp csv-ceph`.
+2 -2
View File
@@ -1,4 +1,4 @@
packageName: rook-ceph
channels:
- name: beta
currentCSV: rook-ceph.v1.2.2
- name: beta
currentCSV: rook-ceph.v1.2.2
-46
View File
@@ -1,46 +0,0 @@
#!/bin/bash
set -e
export OLM_SKIP_PKG_FILE_GEN="true"
if [ -f "Dockerfile" ]; then
# if this is being executed from the images/ceph/ dir,
# back out to the source dir
cd ../../
fi
: "${OLM_CATALOG_DIR:=deploy/olm}"
DEPLOY_DIR="$OLM_CATALOG_DIR/deploy"
CRDS_DIR="$DEPLOY_DIR/crds"
TEMPLATES_DIR="$OLM_CATALOG_DIR/templates"
: "${SED_IN_PLACE:="build/sed-in-place"}"
function generate_template() {
local provider=$1
local csv_manifest_path="$DEPLOY_DIR/olm-catalog/${provider}/9999.9999.9999/manifests"
local tmp_csv_gen_file="$csv_manifest_path/ceph.clusterserviceversion.yaml"
local csv_template_file="$TEMPLATES_DIR/rook-ceph-${provider}.vVERSION.clusterserviceversion.yaml.in"
rm -rf $csv_manifest_path
# v9999.9999.9999 is just a placeholder. operator-sdk requires valid semver here.
(deploy/olm/generate-rook-csv.sh "9999.9999.9999" $provider "{{.RookOperatorImage}}")
mv $tmp_csv_gen_file $csv_template_file
# replace the placeholder with the templated value
$SED_IN_PLACE "s/9999.9999.9999/{{.RookOperatorCsvVersion}}/g" $csv_template_file
echo "Template stored at $csv_template_file"
}
# start clean
if [ -d $TEMPLATES_DIR ]; then
rm -rf $TEMPLATES_DIR
fi
mkdir -p $TEMPLATES_DIR
generate_template "ocp"
generate_template "k8s"
cp -R $CRDS_DIR $TEMPLATES_DIR/
-253
View File
@@ -1,253 +0,0 @@
#!/usr/bin/env bash
set -e
##################
# INIT VARIABLES #
##################
: "${OLM_CATALOG_DIR:=deploy/olm}"
ASSEMBLE_FILE_COMMON="$OLM_CATALOG_DIR/assemble/metadata-common.yaml"
ASSEMBLE_FILE_K8S="$OLM_CATALOG_DIR/assemble/metadata-k8s.yaml"
ASSEMBLE_FILE_OCP="$OLM_CATALOG_DIR/assemble/metadata-ocp.yaml"
ASSEMBLE_FILE_OKD="$OLM_CATALOG_DIR/assemble/metadata-okd.yaml"
PACKAGE_FILE="$OLM_CATALOG_DIR/assemble/rook-ceph.package.yaml"
CRDS_FILE="deploy/examples/crds.yaml"
SUPPORTED_PLATFORMS='k8s|ocp|okd'
operator_sdk="${OPERATOR_SDK:-operator-sdk}"
yq="${YQv3:-yq}"
# Default CSI to true
: "${OLM_INCLUDE_CEPHFS_CSI:=true}"
: "${OLM_INCLUDE_RBD_CSI:=true}"
: "${OLM_INCLUDE_REPORTER:=true}"
##########
# CHECKS #
##########
if ! command -v "$operator_sdk" >/dev/null && [ ! -f "$operator_sdk" ]; then
echo "operator-sdk is not installed $operator_sdk"
echo "follow instructions here: https://github.com/operator-framework/operator-sdk/#quick-start"
exit 1
fi
if ! command -v "$yq" >/dev/null && [ ! -f "$yq" ]; then
echo "yq is not installed"
echo "follow instructions here: https://github.com/mikefarah/yq#install"
exit 1
fi
if [[ "$("$yq" --version)" != "yq version 3."* ]]; then
echo "yq must be version 3" >/dev/stderr
exit 1
fi
if [[ -z "$1" ]]; then
echo "Please provide a version, e.g:"
echo ""
echo "ARGUMENT'S ORDER MATTERS"
echo ""
echo "make csv-ceph CSV_VERSION=1.0.1 CSV_PLATFORM=k8s ROOK_OP_VERSION=rook/ceph:v1.0.1"
exit 1
fi
VERSION=$1
if [[ -z $2 ]]; then
echo "Please provide a platform, choose one of these: $SUPPORTED_PLATFORMS, e.g:"
echo ""
echo "ARGUMENT'S ORDER MATTERS"
echo ""
echo "make csv-ceph CSV_VERSION=1.0.1 CSV_PLATFORM=k8s ROOK_OP_VERSION=rook/ceph:v1.0.1"
exit 1
fi
if [[ -n $2 ]]; then
if [[ ! $2 =~ $SUPPORTED_PLATFORMS ]]; then
echo "Platform $2 is not supported"
echo "Please choose one of these: $SUPPORTED_PLATFORMS"
exit 1
fi
PLATFORM=$2
fi
if [[ -z $3 ]]; then
echo "Please provide an operator version, e.g:"
echo ""
echo "ARGUMENT'S ORDER MATTERS"
echo ""
echo "make csv-ceph CSV_VERSION=1.0.1 CSV_PLATFORM=k8s ROOK_OP_VERSION=rook/ceph:v1.0.1"
exit 1
fi
ROOK_OP_VERSION=$3
#############
# VARIABLES #
#############
: "${SED_IN_PLACE:="build/sed-in-place"}"
YQ_CMD_DELETE=($yq delete -i)
YQ_CMD_MERGE_OVERWRITE=($yq merge --inplace --overwrite --prettyPrint)
YQ_CMD_MERGE=($yq merge --inplace --append -P)
YQ_CMD_WRITE=($yq write --inplace -P)
OPERATOR_YAML_FILE_K8S="deploy/examples/operator.yaml"
OPERATOR_YAML_FILE_OCP="deploy/examples/operator-openshift.yaml"
CSV_PATH="$OLM_CATALOG_DIR/deploy/olm-catalog/${PLATFORM}/${VERSION}"
CSV_BUNDLE_PATH="${CSV_PATH}/manifests"
CSV_FILE_NAME="$CSV_BUNDLE_PATH/ceph.clusterserviceversion.yaml"
OP_SDK_CMD=($operator_sdk generate csv --output-dir="deploy/olm-catalog/${PLATFORM}/${VERSION}" --csv-version)
OLM_OPERATOR_YAML_FILE="$OLM_CATALOG_DIR/deploy/operator.yaml"
OLM_RBAC_YAML_FILE="$OLM_CATALOG_DIR/deploy/rbac.yaml"
CEPH_EXTERNAL_SCRIPT_FILE="deploy/examples/create-external-cluster-resources.py"
if [[ -d "$CSV_BUNDLE_PATH" ]]; then
echo "$CSV_BUNDLE_PATH already exists, not doing anything."
exit 0
fi
#############
# FUNCTIONS #
#############
function create_directories() {
mkdir -p "$CSV_PATH"
mkdir -p "$OLM_CATALOG_DIR/deploy/crds"
}
function cleanup() {
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" metadata.creationTimestamp
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.install.spec.deployments[0].spec.template.metadata.creationTimestamp'
}
function generate_csv() {
pushd "$OLM_CATALOG_DIR" &>/dev/null
"${OP_SDK_CMD[@]}" "$VERSION"
popd &>/dev/null
mv "$CSV_BUNDLE_PATH/olm.clusterserviceversion.yaml" "$CSV_FILE_NAME"
# cleanup to get the expected state before merging the real data from assembles
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.icon[*]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.installModes[*]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.keywords[0]'
"${YQ_CMD_DELETE[@]}" "$CSV_FILE_NAME" 'spec.maintainers[0]'
"${YQ_CMD_MERGE_OVERWRITE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_COMMON"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.annotations.externalClusterScript "$(base64 <$CEPH_EXTERNAL_SCRIPT_FILE)"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.name "rook-ceph.v${VERSION}"
if [[ "$PLATFORM" == "k8s" ]]; then
"${YQ_CMD_MERGE_OVERWRITE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_K8S"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" spec.displayName "Rook-Ceph"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.annotations.createdAt "$(date +"%Y-%m-%dT%H-%M-%SZ")"
fi
if [[ "$PLATFORM" == "ocp" ]]; then
"${YQ_CMD_MERGE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_OCP"
fi
if [[ "$PLATFORM" == "okd" ]]; then
"${YQ_CMD_MERGE[@]}" "$CSV_FILE_NAME" "$ASSEMBLE_FILE_OKD"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" spec.displayName "Rook-Ceph"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.annotations.createdAt "$(date +"%Y-%m-%dT%H-%M-%SZ")"
fi
}
function generate_operator_yaml() {
platform=$2
operator_file=$OPERATOR_YAML_FILE_K8S
if [[ "$platform" == "ocp" ]]; then
operator_file=$OPERATOR_YAML_FILE_OCP
fi
if [[ "$platform" == "okd" ]]; then
operator_file=$OPERATOR_YAML_FILE_OCP
fi
sed -n '/^# OLM: BEGIN OPERATOR DEPLOYMENT$/,/# OLM: END OPERATOR DEPLOYMENT$/p' "$operator_file" >"$OLM_OPERATOR_YAML_FILE"
}
function hack_csv() {
# Let's respect the following mapping
# somehow the operator-sdk command generates serviceAccountNames suffixed with '-rules'
# instead of the service account name
# So that function fixes that
# rook-ceph-system --> serviceAccountName
# rook-ceph-cluster-mgmt --> rule
# rook-ceph-system
# rook-ceph-global
# rook-ceph-mgr --> serviceAccountName
# rook-ceph-mgr --> rule
# rook-ceph-mgr-system --> rule
# rook-ceph-mgr-cluster
# rook-ceph-osd --> serviceAccountName
# rook-ceph-osd --> rule
$SED_IN_PLACE 's/rook-ceph-global/rook-ceph-system/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rook-ceph-object-bucket/rook-ceph-system/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rook-ceph-cluster-mgmt/rook-ceph-system/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rook-ceph-mgr-cluster/rook-ceph-mgr/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rook-ceph-mgr-system/rook-ceph-mgr/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/cephfs-csi-nodeplugin/rook-csi-cephfs-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/cephfs-external-provisioner-runner/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/ceph-nfs-csi-nodeplugin/rook-csi-nfs-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/ceph-nfs-external-provisioner-runner/rook-csi-nfs-provisioner-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rbd-csi-nodeplugin/rook-csi-rbd-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rbd-external-provisioner-runner/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
# The operator-sdk also does not properly respect when
# Roles differ from the Service Account name
# The operator-sdk instead assumes the Role/ClusterRole is the ServiceAccount name
#
# To account for these mappings, we have to replace Role/ClusterRole names with
# the corresponding ServiceAccount.
$SED_IN_PLACE 's/cephfs-external-provisioner-cfg/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rbd-external-provisioner-cfg/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
}
function generate_package() {
"${YQ_CMD_WRITE[@]}" "$PACKAGE_FILE" channels[0].currentCSV "rook-ceph.v${VERSION}"
}
function apply_rook_op_img() {
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" metadata.annotations.containerImage "$ROOK_OP_VERSION"
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" spec.install.spec.deployments[0].spec.template.spec.containers[0].image "$ROOK_OP_VERSION"
}
function validate_crds() {
crds=$(awk '/Kind:/ {print $2}' $CRDS_FILE | grep -vE "ObjectBucketList|ObjectBucketClaimList" | sed 's/List//' | sort)
csv_crds=$(awk '/kind:/ {print $3}' "$CSV_FILE_NAME" | sort)
if [ "$crds" != "$csv_crds" ]; then
echo "CRDs in $CSV_FILE_NAME do not match CRDs in $CRDS_FILE, see the diff below"
echo ""
diff <(echo "$crds") <(echo "$csv_crds")
exit 1
fi
}
########
# MAIN #
########
create_directories
generate_operator_yaml "$@"
# Generate csi nfs rbac too.
export ADDITIONAL_HELM_CLI_OPTIONS="--set csi.nfs.enabled=true --set pspEnable=false"
./build/rbac/get-helm-rbac.sh >"$OLM_RBAC_YAML_FILE"
# TODO: do we need separate clusterrole/clusterrolebinding/role/rolebinding/serviceaccount files, or
# can these just stay in rbac.yaml? If they need to be separate, we can do that here with YQ.
generate_csv "$@"
hack_csv
if [ -z "${OLM_SKIP_PKG_FILE_GEN}" ]; then
generate_package
fi
apply_rook_op_img
cleanup
echo ""
echo "Congratulations!"
echo "Your Rook CSV $VERSION manifest for $PLATFORM is ready at: $CSV_BUNDLE_PATH"
echo "Push it to https://github.com/operator-framework/community-operators as well as the CRDs from the same folder and the package file $PACKAGE_FILE."
+19 -10
View File
@@ -25,9 +25,9 @@ endif
REGISTRY_NAME = quay.io
BASEIMAGE = $(REGISTRY_NAME)/ceph/ceph-$(GOARCH):$(CEPH_VERSION)
CEPH_IMAGE = $(BUILD_REGISTRY)/ceph-$(GOARCH)
OPERATOR_SDK_VERSION = v0.17.1
OPERATOR_SDK_VERSION = v1.25.0
# TODO: update to yq v4 - v3 end of life in Aug 2021 ; v4 removes the 'yq delete' cmd and changes syntax
YQv3_VERSION = 3.3.0
YQv3_VERSION = 3.4.1
GOHOST := GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go
MANIFESTS_DIR=../../deploy/examples
@@ -79,7 +79,11 @@ do.build:
ifeq ($(INCLUDE_CSV_TEMPLATES),true)
@$(MAKE) CSV_TEMPLATE_DIR=$(TEMP) generate-csv-templates
@cp -r $(TEMP)/deploy/olm/templates $(TEMP)/ceph-csv-templates
@$(MAKE) csv
@cp -r ../../build/csv $(TEMP)/ceph-csv-templates
@rm $(TEMP)/ceph-csv-templates/csv-gen.sh
@$(MAKE) csv-clean
else
mkdir $(TEMP)/ceph-csv-templates
endif
@@ -106,6 +110,7 @@ generate-csv-templates: $(OPERATOR_SDK) $(YQv3) ## Generate CSV templates for OL
@# finally, generate the templates in-place using CSV_TEMPLATE_DIR as a staging dir
@mkdir -p $(CSV_TEMPLATE_DIR)
@cp -a ../../deploy $(CSV_TEMPLATE_DIR)/deploy
@set -eE;\
BEFORE_GEN_CRD_SIZE=$$(wc -l < $(MANIFESTS_DIR)/crds.yaml);\
$(MAKE) -C ../.. NO_OB_OBC_VOL_GEN=true MAX_DESC_LEN=0 BUILD_CRDS_INTO_DIR=$(CSV_TEMPLATE_DIR) crds;\
@@ -116,8 +121,7 @@ generate-csv-templates: $(OPERATOR_SDK) $(YQv3) ## Generate CSV templates for OL
echo "length after $$AFTER_GEN_CRD_SIZE";\
exit 1;\
fi
@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"
@echo " === Generated CSV templates"
$(YQv3):
@echo === installing yq $(YQv3_VERSION) $(REAL_HOST_PLATFORM)
@@ -129,16 +133,21 @@ $(OPERATOR_SDK):
@echo === installing operator-sdk $(REAL_HOST_PLATFORM)
@mkdir -p $(TOOLS_HOST_DIR)
@curl -JL -o $(TOOLS_HOST_DIR)/operator-sdk-$(OPERATOR_SDK_VERSION) \
https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk-$(OPERATOR_SDK_VERSION)-$(OPERATOR_SDK_PLATFORM)
https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$(REAL_HOST_PLATFORM)
@chmod +x $(OPERATOR_SDK)
@$(OPERATOR_SDK) version
csv: $(OPERATOR_SDK) $(YQv3) $(HELM) ## Generate a CSV file for OLM.
@echo Generating CSV manifests
@cd ../.. && deploy/olm/generate-rook-csv.sh $(CSV_VERSION) $(CSV_PLATFORM) $(ROOK_OP_VERSION)
csv: $(OPERATOR_SDK) $(YQv3)
@echo generate csv with latest operator-sdk
@mkdir -p ../../build/csv/ceph
@../../build/csv/csv-gen.sh
@# #adding 2>/dev/null since CI doesn't seems to be creating bundle.Dockerfile file
@rm bundle.Dockerfile 2> /dev/null || true
csv-clean: ## Remove existing OLM files.
@rm -fr ../../deploy/olm/deploy/* ../../deploy/olm/templates/*
@rm -fr ../../build/csv/ceph/${go env GOARCH}
@rm -f ../../build/csv/ceph.clusterserviceversion.yaml
@git restore $(MANIFESTS_DIR)/crds.yaml ../../deploy/charts/rook-ceph/templates/resources.yaml
# reading from a file and outputting to the same file can have undefined results, so use this intermediate
IMAGE_TMP="/tmp/rook-ceph-image-list"
+15 -15
View File
@@ -40,20 +40,20 @@ function print_k8s_cluster_status() {
}
function prepare_loop_devices() {
if [ $# -ne 1 ]; then
echo "usage: $0 loop_deivce_count"
exit 1
fi
OSD_COUNT=$1
if [ $OSD_COUNT -le 0 ]; then
echo "Invalid OSD_COUNT $OSD_COUNT. OSD_COUNT must be larger than 0."
exit 1
fi
for i in $(seq 1 $OSD_COUNT); do
sudo dd if=/dev/zero of=~/data${i}.img bs=1M seek=6144 count=0
sudo losetup /dev/loop${i} ~/data${i}.img
done
sudo lsblk
if [ $# -ne 1 ]; then
echo "usage: $0 loop_deivce_count"
exit 1
fi
OSD_COUNT=$1
if [ $OSD_COUNT -le 0 ]; then
echo "Invalid OSD_COUNT $OSD_COUNT. OSD_COUNT must be larger than 0."
exit 1
fi
for i in $(seq 1 $OSD_COUNT); do
sudo dd if=/dev/zero of=~/data${i}.img bs=1M seek=6144 count=0
sudo losetup /dev/loop${i} ~/data${i}.img
done
sudo lsblk
}
function use_local_disk() {
@@ -205,7 +205,7 @@ function validate_yaml() {
kubectl apply -f "${keda_url}"
# skipping folders and some yamls that are only for openshift.
manifests="$(find . -maxdepth 1 -type f -name '*.yaml' -and -not -name '*openshift*' -and -not -name 'scc*' -and -not -name 'psp*')"
manifests="$(find . -maxdepth 1 -type f -name '*.yaml' -and -not -name '*openshift*' -and -not -name 'scc*' -and -not -name 'psp*' -and -not -name 'kustomization*')"
with_f_arg="$(echo "$manifests" | awk '{printf " -f %s",$1}')" # don't add newline
# shellcheck disable=SC2086 # '-f manifest1.yaml -f manifest2.yaml etc.' should not be quoted
kubectl create ${with_f_arg} --dry-run=client