gen-nfs-rbac.sh 772 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. set -xeEuo pipefail
  3. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
  4. pushd "$SCRIPT_DIR" &>/dev/stderr
  5. NFS_RBAC_YAML_FILE="$SCRIPT_DIR/../../deploy/examples/csi/nfs/rbac.yaml"
  6. tmpdir="$(mktemp -d)"
  7. WITHOUT_FILE="${tmpdir}"/without-nfs.yaml # intermediate file of yaml that doesn't include NFS RBAC
  8. WITH_FILE="${tmpdir}"/with-nfs.yaml # intermediate file of yaml that includes previous plus NFS RBAC
  9. ./get-helm-rbac.sh > "$WITHOUT_FILE"
  10. export ADDITIONAL_HELM_CLI_OPTIONS="--set csi.nfs.enabled=true"
  11. ./get-helm-rbac.sh > "$WITH_FILE"
  12. rm -f "$NFS_RBAC_YAML_FILE"
  13. cat nfs-rbac.yaml.header >> "$NFS_RBAC_YAML_FILE"
  14. ./keep-added.sh "$WITHOUT_FILE" "$WITH_FILE" >> "$NFS_RBAC_YAML_FILE"
  15. rm -rf "$tmpdir"
  16. popd &>/dev/stderr