Skip to content

Commit 572d389

Browse files
committed
Fix csi-snapshotter RBAC yaml version
Signed-off-by: Grant Griffiths <[email protected]>
1 parent 152396e commit 572d389

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

prow.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,16 +1066,27 @@ main () {
10661066
docker tag "$i:latest" "$i:csiprow" || die "tagging the locally built container image for $i failed"
10671067
done
10681068

1069-
if [ -e deploy/kubernetes/rbac.yaml ]; then
1070-
# This is one of those components which has its own RBAC rules (like external-provisioner).
1071-
# We are testing a locally built image and also want to test with the the current,
1072-
# potentially modified RBAC rules.
1073-
if [ "$(echo "$cmds" | wc -w)" != 1 ]; then
1074-
die "ambiguous deploy/kubernetes/rbac.yaml: need exactly one command, got: $cmds"
1069+
for i in $cmds; do
1070+
# For components with multiple cmds, the RBAC file should be in the following format:
1071+
# rbac-$cmd.yaml
1072+
# If this file cannot be found, we can default to the standard location:
1073+
# deploy/kubernetes/rbac.yaml
1074+
rbac_file_path=$(find . -type f -name "rbac-$i.yaml")
1075+
if [ $rbac_file_path == "" ]; then
1076+
rbac_file_path="$(pwd)/deploy/kubernetes/rbac.yaml"
10751077
fi
1076-
e=$(echo "$cmds" | tr '[:lower:]' '[:upper:]' | tr - _)
1077-
images="$images ${e}_RBAC=$(pwd)/deploy/kubernetes/rbac.yaml"
1078-
fi
1078+
1079+
if [ -e $rbac_file_path ]; then
1080+
# This is one of those components which has its own RBAC rules (like external-provisioner).
1081+
# We are testing a locally built image and also want to test with the the current,
1082+
# potentially modified RBAC rules.
1083+
1084+
# snapshot-controller RBAC is handled by the cluster manager
1085+
# see install_snapshot_controller() for how this is installed
1086+
e=$(echo "$i" | tr '[:lower:]' '[:upper:]' | tr - _)
1087+
images="$images ${e}_RBAC=$rbac_file_path"
1088+
fi
1089+
done
10791090
fi
10801091

10811092
if tests_need_non_alpha_cluster; then

0 commit comments

Comments
 (0)