@@ -875,7 +875,7 @@ func TestAuthorizationSubjectAccessReviewAPIGroup(t *testing.T) {
875
875
kubeAuthInterface : clusterAdminSARGetter ,
876
876
response : authorizationapi.SubjectAccessReviewResponse {
877
877
Allowed : true ,
878
- Reason : " allowed by openshift authorizer" ,
878
+ Reason : `RBAC: allowed by RoleBinding "admin/hammer-project" of ClusterRole "admin" to User "harold"` ,
879
879
Namespace : "hammer-project" ,
880
880
},
881
881
}.run (t )
@@ -889,7 +889,7 @@ func TestAuthorizationSubjectAccessReviewAPIGroup(t *testing.T) {
889
889
kubeAuthInterface : clusterAdminSARGetter ,
890
890
response : authorizationapi.SubjectAccessReviewResponse {
891
891
Allowed : false ,
892
- Reason : `User "harold" cannot get horizontalpodautoscalers in project "hammer-project" ` ,
892
+ Reason : `` ,
893
893
Namespace : "hammer-project" ,
894
894
},
895
895
}.run (t )
@@ -903,7 +903,7 @@ func TestAuthorizationSubjectAccessReviewAPIGroup(t *testing.T) {
903
903
kubeAuthInterface : clusterAdminKubeClient .Authorization (),
904
904
response : authorizationapi.SubjectAccessReviewResponse {
905
905
Allowed : false ,
906
- Reason : `User "harold" cannot get horizontalpodautoscalers.foo in project "hammer-project" ` ,
906
+ Reason : `` ,
907
907
Namespace : "hammer-project" ,
908
908
},
909
909
}.run (t )
@@ -917,7 +917,7 @@ func TestAuthorizationSubjectAccessReviewAPIGroup(t *testing.T) {
917
917
kubeAuthInterface : clusterAdminSARGetter ,
918
918
response : authorizationapi.SubjectAccessReviewResponse {
919
919
Allowed : false ,
920
- Reason : `User "harold" cannot get horizontalpodautoscalers.* in project "hammer-project" ` ,
920
+ Reason : `` ,
921
921
Namespace : "hammer-project" ,
922
922
},
923
923
}.run (t )
@@ -1068,7 +1068,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1068
1068
kubeAuthInterface : clusterAdminLocalSARGetter ,
1069
1069
response : authorizationapi.SubjectAccessReviewResponse {
1070
1070
Allowed : true ,
1071
- Reason : " allowed by openshift authorizer" ,
1071
+ Reason : `RBAC: allowed by RoleBinding "view/default" of ClusterRole "view" to User "danny"` ,
1072
1072
Namespace : "default" ,
1073
1073
},
1074
1074
}.run (t )
@@ -1133,7 +1133,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1133
1133
kubeAuthInterface : haroldSARGetter ,
1134
1134
response : authorizationapi.SubjectAccessReviewResponse {
1135
1135
Allowed : true ,
1136
- Reason : " allowed by openshift authorizer" ,
1136
+ Reason : `RBAC: allowed by RoleBinding "view/hammer-project" of ClusterRole "view" to User "valerie"` ,
1137
1137
Namespace : "hammer-project" ,
1138
1138
},
1139
1139
}.run (t )
@@ -1160,7 +1160,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1160
1160
kubeAuthInterface : markSARGetter ,
1161
1161
response : authorizationapi.SubjectAccessReviewResponse {
1162
1162
Allowed : true ,
1163
- Reason : " allowed by openshift authorizer" ,
1163
+ Reason : `RBAC: allowed by RoleBinding "edit/mallet-project" of ClusterRole "edit" to User "edgar"` ,
1164
1164
Namespace : "mallet-project" ,
1165
1165
},
1166
1166
}.run (t )
@@ -1214,7 +1214,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1214
1214
kubeAuthInterface : haroldSARGetter ,
1215
1215
response : authorizationapi.SubjectAccessReviewResponse {
1216
1216
Allowed : true ,
1217
- Reason : " allowed by openshift authorizer" ,
1217
+ Reason : `RBAC: allowed by RoleBinding "admin/hammer-project" of ClusterRole "admin" to User "harold"` ,
1218
1218
Namespace : "hammer-project" ,
1219
1219
},
1220
1220
}.run (t )
@@ -1253,7 +1253,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1253
1253
kubeAuthInterface : haroldSARGetter ,
1254
1254
response : authorizationapi.SubjectAccessReviewResponse {
1255
1255
Allowed : true ,
1256
- Reason : " allowed by openshift authorizer" ,
1256
+ Reason : `RBAC: allowed by RoleBinding "admin/hammer-project" of ClusterRole "admin" to User "harold"` ,
1257
1257
Namespace : "hammer-project" ,
1258
1258
},
1259
1259
}.run (t )
@@ -1264,7 +1264,7 @@ func TestAuthorizationSubjectAccessReview(t *testing.T) {
1264
1264
kubeAuthInterface : anonymousSARGetter ,
1265
1265
response : authorizationapi.SubjectAccessReviewResponse {
1266
1266
Allowed : true ,
1267
- Reason : " allowed by openshift authorizer" ,
1267
+ Reason : `RBAC: allowed by RoleBinding "edit/hammer-project" of ClusterRole "edit" to User "system:anonymous"` ,
1268
1268
Namespace : "hammer-project" ,
1269
1269
},
1270
1270
}.run (t )
@@ -1368,8 +1368,8 @@ func TestBrowserSafeAuthorizer(t *testing.T) {
1368
1368
if errProxy == nil {
1369
1369
return false
1370
1370
}
1371
- return strings .Contains (errProxy .Error (), `cannot "unsafeproxy" " pods" with name "podX1:8080" in project "ns"` ) ||
1372
- strings .Contains (errProxy .Error (), `cannot get pods/unsafeproxy in project "ns"` )
1371
+ return strings .Contains (errProxy .Error (), `cannot proxy pods in namespace "ns"` ) ||
1372
+ strings .Contains (errProxy .Error (), `cannot get pods/proxy in namespace "ns"` )
1373
1373
}
1374
1374
1375
1375
for _ , tc := range []struct {
0 commit comments