@@ -1064,18 +1064,24 @@ main () {
1064
1064
# always pulling the image
1065
1065
# (https://github.com/kubernetes-sigs/kind/issues/328).
1066
1066
docker tag " $i :latest" " $i :csiprow" || die " tagging the locally built container image for $i failed"
1067
- done
1068
1067
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 "
1068
+ # For components with multiple cmds, the RBAC file should be in the following format:
1069
+ # rbac-$cmd.yaml
1070
+ # If this file cannot be found, we can default to the standard location:
1071
+ # deploy/kubernetes/rbac.yaml
1072
+ rbac_file_path=$( find . -type f -name " rbac-$i .yaml" )
1073
+ if [ " $rbac_file_path " == " " ]; then
1074
+ rbac_file_path=" $( pwd) /deploy/kubernetes/rbac.yaml"
1075
1075
fi
1076
- e=$( echo " $cmds " | tr ' [:lower:]' ' [:upper:]' | tr - _)
1077
- images=" $images ${e} _RBAC=$( pwd) /deploy/kubernetes/rbac.yaml"
1078
- fi
1076
+
1077
+ if [ -e " $rbac_file_path " ]; then
1078
+ # This is one of those components which has its own RBAC rules (like external-provisioner).
1079
+ # We are testing a locally built image and also want to test with the the current,
1080
+ # potentially modified RBAC rules.
1081
+ e=$( echo " $i " | tr ' [:lower:]' ' [:upper:]' | tr - _)
1082
+ images=" $images ${e} _RBAC=$rbac_file_path "
1083
+ fi
1084
+ done
1079
1085
fi
1080
1086
1081
1087
if tests_need_non_alpha_cluster; then
0 commit comments