Runs kubectl diff and apply, prompting to accept any changes before applying
Must be given kubectl args to provide the input yaml(s), eg:
${0##*/} -f file.yaml
kustomize build |${0##*/} -f -
Highly recommended to specify --context to avoid race conditions in global kube config which could apply to the wrong cluster. See kubectl.sh for more details
${0##*/} -f file.yaml --context=gke_...
See Also:
kustomize_diff_apply.sh - runs kustomize build, precreates namespaces, and then runs this diff and apply
kubectl_create_namespaces.sh - creates any namespaces in the yaml inputs to allow an initial diff to succeed
"
# used by usage() in lib/utils.sh
# shellcheck disable=SC2034
usage_args="<kubectl_options>"
help_usage "$@"
stdin=0
yaml=""
# there is no space before -f in $* if given as first argument
#if [[ "$*" =~ [[:space:]]-f[[:space:]]*- ]]; then