Browse code

Protobuf stringers disabled for OptionalNames

Clayton Coleman authored on 2016/09/14 01:44:28
Showing 3 changed files
... ...
@@ -1,6 +1,8 @@
1 1
 package v1
2 2
 
3 3
 import (
4
+	"fmt"
5
+
4 6
 	"k8s.io/kubernetes/pkg/api/unversioned"
5 7
 	kapi "k8s.io/kubernetes/pkg/api/v1"
6 8
 	kruntime "k8s.io/kubernetes/pkg/runtime"
... ...
@@ -51,8 +53,13 @@ type Role struct {
51 51
 
52 52
 // OptionalNames is an array that may also be left nil to distinguish between set and unset.
53 53
 // +protobuf.nullable=true
54
+// +protobuf.options.(gogoproto.goproto_stringer)=false
54 55
 type OptionalNames []string
55 56
 
57
+func (t OptionalNames) String() string {
58
+	return fmt.Sprintf("%v", []string(t))
59
+}
60
+
56 61
 // RoleBinding references a Role, but not contain it.  It can reference any Role in the same namespace or in the global namespace.
57 62
 // It adds who information via Users and Groups and namespace information by which namespace it exists in.  RoleBindings in a given
58 63
 // namespace only have effect in that namespace (excepting the master namespace which has power in all namespaces).
... ...
@@ -201,8 +208,13 @@ type SubjectAccessReviewResponse struct {
201 201
 
202 202
 // OptionalScopes is an array that may also be left nil to distinguish between set and unset.
203 203
 // +protobuf.nullable=true
204
+// +protobuf.options.(gogoproto.goproto_stringer)=false
204 205
 type OptionalScopes []string
205 206
 
207
+func (t OptionalScopes) String() string {
208
+	return fmt.Sprintf("%v", []string(t))
209
+}
210
+
206 211
 // SubjectAccessReview is an object for requesting information about whether a user or group can perform an action
207 212
 type SubjectAccessReview struct {
208 213
 	unversioned.TypeMeta `json:",inline"`
... ...
@@ -1,6 +1,8 @@
1 1
 package v1
2 2
 
3 3
 import (
4
+	"fmt"
5
+
4 6
 	"k8s.io/kubernetes/pkg/api/unversioned"
5 7
 	kapi "k8s.io/kubernetes/pkg/api/v1"
6 8
 	"k8s.io/kubernetes/pkg/util/intstr"
... ...
@@ -254,8 +256,13 @@ type DeploymentConfig struct {
254 254
 
255 255
 // DeploymentTriggerPolicies is a list of policies where nil values and different from empty arrays.
256 256
 // +protobuf.nullable=true
257
+// +protobuf.options.(gogoproto.goproto_stringer)=false
257 258
 type DeploymentTriggerPolicies []DeploymentTriggerPolicy
258 259
 
260
+func (t DeploymentTriggerPolicies) String() string {
261
+	return fmt.Sprintf("%v", []DeploymentTriggerPolicy(t))
262
+}
263
+
259 264
 // DeploymentConfigSpec represents the desired state of the deployment.
260 265
 type DeploymentConfigSpec struct {
261 266
 	// Strategy describes how a deployment is executed.
... ...
@@ -1,6 +1,8 @@
1 1
 package v1
2 2
 
3 3
 import (
4
+	"fmt"
5
+
4 6
 	"k8s.io/kubernetes/pkg/api/unversioned"
5 7
 	kapi "k8s.io/kubernetes/pkg/api/v1"
6 8
 )
... ...
@@ -78,8 +80,13 @@ type UserIdentityMapping struct {
78 78
 
79 79
 // OptionalNames is an array that may also be left nil to distinguish between set and unset.
80 80
 // +protobuf.nullable=true
81
+// +protobuf.options.(gogoproto.goproto_stringer)=false
81 82
 type OptionalNames []string
82 83
 
84
+func (t OptionalNames) String() string {
85
+	return fmt.Sprintf("%v", []string(t))
86
+}
87
+
83 88
 // Group represents a referenceable set of Users
84 89
 type Group struct {
85 90
 	unversioned.TypeMeta `json:",inline"`