From 2d377db3f1f241ba7822dde5ca7681b237333462 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Mon, 29 Jul 2024 14:46:54 +0000 Subject: [PATCH] chore: add comments on the generate-manifests script Signed-off-by: Abhinandan Purkait --- buildscripts/generate-manifests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildscripts/generate-manifests.sh b/buildscripts/generate-manifests.sh index 168cbc958..3067952eb 100755 --- a/buildscripts/generate-manifests.sh +++ b/buildscripts/generate-manifests.sh @@ -23,13 +23,18 @@ $CONTROLLER_GEN crd:trivialVersions=false,preserveUnknownFields=false paths=./pk for FILE in "$DEPLOY_YAML_DIR"/zfs.openebs.io_*; do BASE_NAME=$(basename "$FILE" | sed -e 's/^zfs.openebs.io_//' -e 's/s\.yaml$/.yaml/') NEW_FILE="$DEPLOY_YAML_DIR/${BASE_NAME%.yaml}-crd.yaml" + # Rename the files generated in the format -crd.yaml mv "$FILE" "$NEW_FILE" + # Copy the files to the crd subchart templates, in format .yaml TARGET_FILE="$CRD_CHART_TEMPLATE_DIR/${BASE_NAME%.yaml}.yaml" cp "$NEW_FILE" "$TARGET_FILE" + # Append the helm configuration to enable disable the keep the crds on uninstall. awk '/controller-gen.kubebuilder.io\/version:/ { print; print " {{- include \"crds.extraAnnotations\" .Values.zfsLocalPv | nindent 4 }}"; next }1' "$TARGET_FILE" > "$TARGET_FILE.tmp" && mv "$TARGET_FILE.tmp" "$TARGET_FILE" + # Append the helm configuration to enable disable the installation of the crds. awk 'BEGIN { print "{{- if .Values.zfsLocalPv.enabled -}}" } { print } END { if (NR > 0) print "{{- end -}}" }' "$TARGET_FILE" > "$TARGET_FILE.tmp" && mv "$TARGET_FILE.tmp" "$TARGET_FILE" done +# Generate the zfs-operator.yaml using the helm chart. helm template "$RELEASE_NAME" "$HELM_CHART_DIR" -n "$RELEASE_NAMESPACE" --set analytics.installerType="zfs-operator" > "$DEPLOY_YAML_DIR"/../zfs-operator.yaml