pkg/apis/rbac: make apiversion optional for subjects and fix validation

This commit is contained in:
Eric Chiang
2016-06-07 10:53:18 -07:00
parent 8bcecac12f
commit 88119903e5
3 changed files with 2 additions and 15 deletions

View File

@@ -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"},