Skip to content

Commit

Permalink
Fix removeInfoCenter.sh to deal with random pod names (scale instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredg02 committed Dec 7, 2021
1 parent a1036bb commit 636cf12
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions infoCenter/k8s/removeInfoCenter.sh
Expand Up @@ -16,17 +16,18 @@ set -o pipefail

# Parameters:
release_name=${1:-}
namespace="infocenter"

# Verify inputs
if [[ -z "${release_name}" ]]; then
printf "ERROR: a release name must be given.\n"
exit 1
fi

oc delete pod infocenter-${release_name}-0 -n infocenter --force --grace-period=0
oc delete sts infocenter-${release_name} -n infocenter
oc delete service infocenter-${release_name} -n infocenter
oc delete route infocenter-${release_name} -n infocenter
oc scale deployment infocenter-${release_name} -n="${namespace}" --replicas=0
oc delete deployment infocenter-${release_name} -n "${namespace}"
oc delete service infocenter-${release_name} -n "${namespace}"
oc delete route infocenter-${release_name} -n "${namespace}"

remove_question() {
read -p "Do you want to remove the folder for ${release_name}? (Y)es, (N)o, E(x)it: " yn
Expand Down

0 comments on commit 636cf12

Please sign in to comment.