mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
pkg/apis/rbac: make apiversion optional for subjects and fix validation
This commit is contained in:
@@ -96,15 +96,6 @@ func TestValidateRoleBinding(t *testing.T) {
|
||||
T: field.ErrorTypeInvalid,
|
||||
F: "subjects[0].name",
|
||||
},
|
||||
"forbidden fields": {
|
||||
A: rbac.RoleBinding{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: api.NamespaceDefault, Name: "master"},
|
||||
RoleRef: api.ObjectReference{Namespace: "master", Name: "valid"},
|
||||
Subjects: []rbac.Subject{{Name: "subject", Kind: rbac.ServiceAccountKind, APIVersion: "foo"}},
|
||||
},
|
||||
T: field.ErrorTypeForbidden,
|
||||
F: "subjects[0].apiVersion",
|
||||
},
|
||||
"missing subject name": {
|
||||
A: rbac.RoleBinding{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: api.NamespaceDefault, Name: "master"},
|
||||
|
||||
Reference in New Issue
Block a user