From fd5fc8f3d630520525ae2b91a0d4cd5d4f19e3e6 Mon Sep 17 00:00:00 2001 From: Wilson Radadia <159131702+WilsonRadadia20@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:52:56 +0530 Subject: [PATCH] Fix for Helm Installation checking Snapshot CRD Only When Snapshot Enabled is True (#253) * Update for installation check of the snapshot * Update the k8s version * Remove the unnecessary echo --- dell-csi-helm-installer/verify-csi-unity.sh | 10 +++++++--- dell-csi-helm-installer/verify.sh | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dell-csi-helm-installer/verify-csi-unity.sh b/dell-csi-helm-installer/verify-csi-unity.sh index 2a52874..f250816 100644 --- a/dell-csi-helm-installer/verify-csi-unity.sh +++ b/dell-csi-helm-installer/verify-csi-unity.sh @@ -15,14 +15,18 @@ function verify-csi-unity() { verify_namespace "${NS}" verify_required_secrets "${RELEASE}-creds" verify_optional_secrets "${RELEASE}-certs" - verify_alpha_snap_resources + snapshot_value=$(is_snapshot_enabled) + if [ "$snapshot_value" == "true" ]; then + verify_alpha_snap_resources + fi verify_unity_protocol_installation - verify_snap_requirements + if [ "$snapshot_value" == "true" ]; then + verify_snap_requirements + fi verify_helm_3 verify_helm_values_version "${DRIVER_VERSION}" } - function verify_unity_protocol_installation() { if [ ${NODE_VERIFY} -eq 0 ]; then return diff --git a/dell-csi-helm-installer/verify.sh b/dell-csi-helm-installer/verify.sh index 1249aea..682628b 100755 --- a/dell-csi-helm-installer/verify.sh +++ b/dell-csi-helm-installer/verify.sh @@ -41,6 +41,10 @@ function source-verify-driver() { fi } +function is_snapshot_enabled() { +snapshot_enabled=$(sed -n '/snapshot:/,/resizer:/p' "$VALUES" | grep -v '^\s*#' | grep "enabled:" | awk '{print $2}') +} + # # verify-driver will call the proper method to verify a specific driver