Merge pull request #31543 from deads2k/rbac-06-change-role-ref

Automatic merge from submit-queue

Change rbac roleref to reflect the information we want

@liggitt @ericchiang This is a version of https://github.com/kubernetes/kubernetes/pull/31359 which updates the `RoleRef` to be (I think) the type that we want, with a group, resource, and name.

This is **not** backwards compatible with any existing data.  I'm ok with doing this since rbac was considered alpha, but its something to consider.

If we want this instead, I'll close the previous pull (or update it with this content).
This commit is contained in:
Kubernetes Submit Queue
2016-09-12 02:01:49 -07:00
committed by GitHub
20 changed files with 2186 additions and 1468 deletions

View File

@@ -303,7 +303,7 @@ func TestRBAC(t *testing.T) {
Subjects: []v1alpha1.Subject{
{Kind: "User", Name: "pod-reader"},
},
RoleRef: v1.ObjectReference{Kind: "ClusterRole", Name: "read-pods"},
RoleRef: v1alpha1.RoleRef{Kind: "ClusterRole", Name: "read-pods"},
},
},
},
@@ -335,14 +335,14 @@ func TestRBAC(t *testing.T) {
{
ObjectMeta: v1.ObjectMeta{Name: "write-jobs"},
Subjects: []v1alpha1.Subject{{Kind: "User", Name: "job-writer"}},
RoleRef: v1.ObjectReference{Kind: "ClusterRole", Name: "write-jobs"},
RoleRef: v1alpha1.RoleRef{Kind: "ClusterRole", Name: "write-jobs"},
},
},
roleBindings: []v1alpha1.RoleBinding{
{
ObjectMeta: v1.ObjectMeta{Name: "write-jobs", Namespace: "job-namespace"},
Subjects: []v1alpha1.Subject{{Kind: "User", Name: "job-writer-namespace"}},
RoleRef: v1.ObjectReference{Kind: "ClusterRole", Name: "write-jobs"},
RoleRef: v1alpha1.RoleRef{Kind: "ClusterRole", Name: "write-jobs"},
},
},
},