38 lines
605 B
Plaintext
Raw Normal View History

2022-01-14 15:06:31 +00:00
#!/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
2022-01-14 15:06:31 +00:00
fi