get-helm-rbac.sh 810 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. set -eEuox pipefail
  3. : "${HELM:=helm}"
  4. if ! command -v "$HELM" &>/dev/null; then
  5. echo "Helm not found. Please install it: https://helm.sh/docs/intro/install/"
  6. exit 1
  7. fi
  8. # Supply additional CLI options to the helm command used for generating RBAC.
  9. # e.g., '--set key=value'
  10. : "${ADDITIONAL_HELM_CLI_OPTIONS:=""}"
  11. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
  12. pushd "$SCRIPT_DIR" &>/dev/stderr
  13. options=(
  14. --namespace rook-ceph
  15. --set crds.enabled=false
  16. --set csi.csiAddons.enabled=true
  17. )
  18. for option in ${ADDITIONAL_HELM_CLI_OPTIONS}; do
  19. options+=("$option")
  20. done
  21. echo "generating Helm template with options: ${options[*]}" &>/dev/stderr
  22. ${HELM} template ../../deploy/charts/rook-ceph "${options[@]}" --debug | ./keep-rbac-yaml.sh
  23. popd &>/dev/stderr