38 lines
605 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
#####
# Wrapper around "helm delete" that considers the delete successful if
# the release does not exist
#####
RELEASE=$1
shift
NAMESPACE_ARG=
HELM_ARGS=
while :; do
case $1 in
--help)
helm delete --help
exit
;;
--namespace)
NAMESPACE_ARG="$1 $2"
shift
;;
?*)
HELM_ARGS="$HELM_ARGS $1"
;;
*)
break
esac
shift
done
set -e
if helm-exists $RELEASE $NAMESPACE_ARG; then
exec helm delete $RELEASE $NAMESPACE_ARG $HELM_ARGS
fi