Files
stream-applications/scripts/delete-secret.sh
2022-11-02 11:09:47 +02:00

15 lines
292 B
Bash
Executable File

#!/bin/bash
NS=default
if [ "$1" == "" ]; then
echo "Arguments: <secret-name> [namespace]"
exit 1
fi
SECRET=$1
if [ "$2" != "" ]; then
NS=$2
fi
COUNT=$(kubectl get secrets --namespace $NS | grep -c -F "$SECRET")
if ((COUNT > 0)); then
kubectl delete secret $SECRET --namespace $NS
fi