From 513e156db4f421ba6fc2e8668633f0fe781f7368 Mon Sep 17 00:00:00 2001 From: Regina Richardson Date: Mon, 12 Feb 2024 16:40:38 -0800 Subject: [PATCH] If files are not generated from the commands, then remove the directory created - Adjusted code for the case where the subscriptions folder or the cluster service version folder are empty they will be removed from the directory --- generate_postmortem.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_postmortem.sh b/generate_postmortem.sh index 89631c8..647e494 100755 --- a/generate_postmortem.sh +++ b/generate_postmortem.sh @@ -1839,7 +1839,7 @@ for NAMESPACE in $NAMESPACE_LIST; do [ $? -eq 0 ] || rm -f "${ICS_SUBSCRIPTION_YAML_OUTPUT}/${sub}.out" done <<< "$OUTPUT" else - rm -fr $ICS_INSTALL_PLAN_DATA + rm -fr $ICS_SUBSCRIPTION_DATA fi OUTPUT=`$KUBECTL get ClusterServiceVersion -n $NAMESPACE 2>/dev/null` @@ -1854,7 +1854,7 @@ for NAMESPACE in $NAMESPACE_LIST; do [ $? -eq 0 ] || rm -f "${ICS_CLUSTER_SERVICE_VERSION_YAML_OUTPUT}/${csv}.out" done <<< "$OUTPUT" else - rm -fr $ICS_INSTALL_PLAN_DATA + rm -fr $ICS_CLUSTER_SERVICE_VERSION_DATA fi fi #------------------------------------------------------------------------------------------------------