From ab17fabe5f1d4f4cfd3668a5b0be41425fc365f0 Mon Sep 17 00:00:00 2001 From: Oleg Shaldybin Date: Mon, 6 Jun 2016 17:03:44 -0700 Subject: [PATCH 1/2] Rename RBAC subject field Should be plural 'subjects', assuming singular 'subject' was a typo. --- pkg/apis/rbac/v1alpha1/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/rbac/v1alpha1/types.go b/pkg/apis/rbac/v1alpha1/types.go index 0863dfbf588..3ecc55fd0b1 100644 --- a/pkg/apis/rbac/v1alpha1/types.go +++ b/pkg/apis/rbac/v1alpha1/types.go @@ -87,7 +87,7 @@ type RoleBinding struct { v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Subjects holds references to the objects the role applies to. - Subjects []Subject `json:"subject" protobuf:"bytes,2,rep,name=subjects"` + Subjects []Subject `json:"subjects" protobuf:"bytes,2,rep,name=subjects"` // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. @@ -136,7 +136,7 @@ type ClusterRoleBinding struct { v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Subjects holds references to the objects the role applies to. - Subjects []Subject `json:"subject" protobuf:"bytes,2,rep,name=subjects"` + Subjects []Subject `json:"subjects" protobuf:"bytes,2,rep,name=subjects"` // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. From 14a60436b2536ee867c0f52970d8a690885b7ce3 Mon Sep 17 00:00:00 2001 From: Oleg Shaldybin Date: Mon, 6 Jun 2016 17:44:46 -0700 Subject: [PATCH 2/2] Regenerate all --- api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json | 8 ++++---- pkg/apis/rbac/v1alpha1/generated.proto | 4 ++-- pkg/apis/rbac/v1alpha1/types.generated.go | 8 ++++---- pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json b/api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json index e60b5629584..c7bdb56df1f 100644 --- a/api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json +++ b/api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json @@ -2685,7 +2685,7 @@ "id": "v1alpha1.ClusterRoleBinding", "description": "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.", "required": [ - "subject", + "subjects", "roleRef" ], "properties": { @@ -2701,7 +2701,7 @@ "$ref": "v1.ObjectMeta", "description": "Standard object's metadata." }, - "subject": { + "subjects": { "type": "array", "items": { "$ref": "v1alpha1.Subject" @@ -3152,7 +3152,7 @@ "id": "v1alpha1.RoleBinding", "description": "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.", "required": [ - "subject", + "subjects", "roleRef" ], "properties": { @@ -3168,7 +3168,7 @@ "$ref": "v1.ObjectMeta", "description": "Standard object's metadata." }, - "subject": { + "subjects": { "type": "array", "items": { "$ref": "v1alpha1.Subject" diff --git a/pkg/apis/rbac/v1alpha1/generated.proto b/pkg/apis/rbac/v1alpha1/generated.proto index 71a2f612f14..816a85f623d 100644 --- a/pkg/apis/rbac/v1alpha1/generated.proto +++ b/pkg/apis/rbac/v1alpha1/generated.proto @@ -46,7 +46,7 @@ message ClusterRoleBinding { optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; // Subjects holds references to the objects the role applies to. - repeated Subject subject = 2; + repeated Subject subjects = 2; // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. @@ -114,7 +114,7 @@ message RoleBinding { optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; // Subjects holds references to the objects the role applies to. - repeated Subject subject = 2; + repeated Subject subjects = 2; // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. diff --git a/pkg/apis/rbac/v1alpha1/types.generated.go b/pkg/apis/rbac/v1alpha1/types.generated.go index f2e010ad1bc..c2b777a92da 100644 --- a/pkg/apis/rbac/v1alpha1/types.generated.go +++ b/pkg/apis/rbac/v1alpha1/types.generated.go @@ -1263,7 +1263,7 @@ func (x *RoleBinding) CodecEncodeSelf(e *codec1978.Encoder) { } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("subject")) + r.EncodeString(codecSelferC_UTF81234, string("subjects")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Subjects == nil { r.EncodeNil() @@ -1405,7 +1405,7 @@ func (x *RoleBinding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yyv4 := &x.ObjectMeta yyv4.CodecDecodeSelf(d) } - case "subject": + case "subjects": if r.TryDecodeAsNil() { x.Subjects = nil } else { @@ -2626,7 +2626,7 @@ func (x *ClusterRoleBinding) CodecEncodeSelf(e *codec1978.Encoder) { } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("subject")) + r.EncodeString(codecSelferC_UTF81234, string("subjects")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Subjects == nil { r.EncodeNil() @@ -2768,7 +2768,7 @@ func (x *ClusterRoleBinding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) yyv4 := &x.ObjectMeta yyv4.CodecDecodeSelf(d) } - case "subject": + case "subjects": if r.TryDecodeAsNil() { x.Subjects = nil } else { diff --git a/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go b/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go index c9d723469df..0ebda2296dc 100644 --- a/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go +++ b/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go @@ -40,7 +40,7 @@ func (ClusterRole) SwaggerDoc() map[string]string { var map_ClusterRoleBinding = map[string]string{ "": "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.", "metadata": "Standard object's metadata.", - "subject": "Subjects holds references to the objects the role applies to.", + "subjects": "Subjects holds references to the objects the role applies to.", "roleRef": "RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", } @@ -95,7 +95,7 @@ func (Role) SwaggerDoc() map[string]string { var map_RoleBinding = map[string]string{ "": "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.", "metadata": "Standard object's metadata.", - "subject": "Subjects holds references to the objects the role applies to.", + "subjects": "Subjects holds references to the objects the role applies to.", "roleRef": "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", }