@@ -1066,16 +1066,27 @@ main () {
1066
1066
docker tag " $i :latest" " $i :csiprow" || die " tagging the locally built container image for $i failed"
1067
1067
done
1068
1068
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"
1075
1077
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
1079
1090
fi
1080
1091
1081
1092
if tests_need_non_alpha_cluster; then
0 commit comments