diff --git a/scripts/easy-secrets-gen.sh b/scripts/easy-secrets-gen.sh index dccc78922..345c116a3 100755 --- a/scripts/easy-secrets-gen.sh +++ b/scripts/easy-secrets-gen.sh @@ -9,6 +9,11 @@ if ! type -p kubeseal kubectl > /dev/null; then exit 1 fi +if ! $(kubectl api-resources | grep -q sealedsecrets); then + echo "Your cluster doesn't appear to have the sealed secrets operator installed." >&2 + exit 1 +fi + function secret-seal-stdin() { # this is meant to be piped to # $1 is output file, -w diff --git a/scripts/gitops-secrets-gen.sh b/scripts/gitops-secrets-gen.sh index cedf2a9bb..9f71a8bfa 100755 --- a/scripts/gitops-secrets-gen.sh +++ b/scripts/gitops-secrets-gen.sh @@ -7,6 +7,16 @@ function usage() { exit 1 } +if ! type -p kubeseal kubectl > /dev/null; then + echo "You must have kubeseal & kubectl installed to use this script" >&2 + exit 1 +fi + +if ! $(kubectl api-resources | grep -q sealedsecrets); then + echo "Your cluster doesn't appear to have the sealed secrets operator installed." >&2 + exit 1 +fi + function secret-seal-stdin() { # this is meant to be piped to # $1 is output file, -w