Silence output

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2022-03-18 07:37:01 +00:00
parent 28b8a20ff9
commit 475b4d3b5f
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78
2 changed files with 6 additions and 5 deletions

View File

@ -54,7 +54,7 @@ fi
NAMES="$(kubectl api-resources --namespaced --verbs list -o name | tr '\n' ,)" NAMES="$(kubectl api-resources --namespaced --verbs list -o name | tr '\n' ,)"
if [[ "$ALL_NAMESPACES" == "true" ]]; then if [[ "$ALL_NAMESPACES" == "true" ]]; then
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -A kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -A 2>/dev/null
else else
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE} kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE} 2>/dev/null
fi fi

View File

@ -46,14 +46,15 @@ if [ ${#POS_ARGS[@]} -lt 2 ]; then
exit 1 exit 1
fi fi
printf "⚠️ This could leave cloud resources undeleted if finalizers aren't honoured. ⚠️\n" printf "⚠️ This could leave cloud resources undeleted if finalizers aren't honoured ⚠️\n\n"
printf "Are you sure you want to delete ${POS_ARGS[0]}/${POS_ARGS[1]}? (y/n): " printf "Are you sure you want to delete ${POS_ARGS[0]}/${POS_ARGS[1]}? (y/n): "
read CONFIRM read CONFIRM
if [ "${CONFIRM}" = "y" ]; then if [ "${CONFIRM}" = "y" ]; then
echo ""
echo "💣 OK, I hope you know what you're doing..." echo "💣 OK, I hope you know what you're doing..."
kubectl patch -p '{"metadata":{"finalizers":null}}' --type=merge -n ${NAMESPACE} ${POS_ARGS[@]} kubectl patch -p '{"metadata":{"finalizers":null}}' --type=merge -n ${NAMESPACE} ${POS_ARGS[@]} 1>/dev/null
kubectl delete -n ${NAMESPACE} ${POS_ARGS[@]} kubectl delete -n ${NAMESPACE} ${POS_ARGS[@]} 2>/dev/null || printf ""
else else
echo "Aborting..." echo "Aborting..."
exit 1 exit 1