|
@@ -17,18 +17,18 @@ yq e -Ns "\"${HELM_DIR}/templates/crds/\" + .spec.names.singular" ${BUNDLE_DIR}/
|
|
|
|
|
|
|
|
# Add helm if statement for controlling the install of CRDs
|
|
# Add helm if statement for controlling the install of CRDs
|
|
|
for i in "${HELM_DIR}"/templates/crds/*.yml; do
|
|
for i in "${HELM_DIR}"/templates/crds/*.yml; do
|
|
|
- export CRDS_FLAG_NAME="create$(yq e '.spec.names.kind' $i)"
|
|
|
|
|
|
|
+ export CRDS_FLAG_NAME="create$(yq e '.spec.names.kind' "${i}")"
|
|
|
cp "$i" "$i.bkp"
|
|
cp "$i" "$i.bkp"
|
|
|
- if [[ "$CRDS_FLAG_NAME" == *"ExternalSecret"* || "$CRDS_FLAG_NAME" == *"SecretStore"* ]]; then
|
|
|
|
|
|
|
+ if [[ "${CRDS_FLAG_NAME}" == *"ExternalSecret"* || "${CRDS_FLAG_NAME}" == *"SecretStore"* ]]; then
|
|
|
yq e '(.spec.versions[] | select(.name == "v1alpha1")) |= ("{{- if .Values.crds.conversion.enabled }}\n \(.)\n {{- end }}")' -i "$i.bkp" || true
|
|
yq e '(.spec.versions[] | select(.name == "v1alpha1")) |= ("{{- if .Values.crds.conversion.enabled }}\n \(.)\n {{- end }}")' -i "$i.bkp" || true
|
|
|
$SEDPRG -i '/- |-/d' "$i.bkp"
|
|
$SEDPRG -i '/- |-/d' "$i.bkp"
|
|
|
# Indent the remaining additionalPrinterColumn property right
|
|
# Indent the remaining additionalPrinterColumn property right
|
|
|
$SEDPRG -i 's/ additionalPrinterColumns:/ - additionalPrinterColumns:/' "$i.bkp"
|
|
$SEDPRG -i 's/ additionalPrinterColumns:/ - additionalPrinterColumns:/' "$i.bkp"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- if [[ "$CRDS_FLAG_NAME" == *"Cluster"* ]]; then
|
|
|
|
|
|
|
+ if [[ "${CRDS_FLAG_NAME}" == *"Cluster"* ]]; then
|
|
|
echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
|
|
echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
|
|
|
- elif [[ "$CRDS_FLAG_NAME" == *"PushSecret"* ]]; then
|
|
|
|
|
|
|
+ elif [[ "${CRDS_FLAG_NAME}" == *"PushSecret"* ]]; then
|
|
|
echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
|
|
echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
|
|
|
else
|
|
else
|
|
|
echo "{{- if .Values.installCRDs }}" > "$i"
|
|
echo "{{- if .Values.installCRDs }}" > "$i"
|