From e0d3d652f604b9f10f472188dbce71cecca646bc Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Fri, 9 Jun 2017 22:36:32 +0800 Subject: [PATCH 1/3] Made image as required in v1 Container struct. --- pkg/api/v1/types.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 04336366aa9..ee69b988b39 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -1721,8 +1721,7 @@ type Container struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Docker image name. // More info: https://kubernetes.io/docs/concepts/containers/images - // +optional - Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` + Image string `json:"image" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable From 9ecb5d9f4f609f3c53814e62b4af12591aa4ea3b Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Sat, 10 Jun 2017 02:43:05 -0400 Subject: [PATCH 2/3] Generated code. --- api/openapi-spec/swagger.json | 3 +- api/swagger-spec/apps_v1beta1.json | 3 +- api/swagger-spec/batch_v1.json | 3 +- api/swagger-spec/batch_v2alpha1.json | 3 +- api/swagger-spec/extensions_v1beta1.json | 3 +- api/swagger-spec/v1.json | 3 +- .../apps/v1beta1/definitions.html | 4 +-- docs/api-reference/batch/v1/definitions.html | 4 +-- .../batch/v2alpha1/definitions.html | 4 +-- .../extensions/v1beta1/definitions.html | 4 +-- docs/api-reference/v1/definitions.html | 4 +-- federation/apis/openapi-spec/swagger.json | 3 +- .../apis/swagger-spec/extensions_v1beta1.json | 3 +- .../extensions/v1beta1/definitions.html | 4 +-- pkg/api/v1/generated.proto | 1 - pkg/api/v1/types.generated.go | 33 ++++++++----------- 16 files changed, 41 insertions(+), 41 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 70ade600a09..7b58c82cb74 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -47260,7 +47260,8 @@ "io.k8s.kubernetes.pkg.api.v1.Container": { "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "args": { diff --git a/api/swagger-spec/apps_v1beta1.json b/api/swagger-spec/apps_v1beta1.json index 2a6e7d973e8..a95df12347f 100644 --- a/api/swagger-spec/apps_v1beta1.json +++ b/api/swagger-spec/apps_v1beta1.json @@ -4842,7 +4842,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/api/swagger-spec/batch_v1.json b/api/swagger-spec/batch_v1.json index 429b0b3e6fa..916667489b4 100644 --- a/api/swagger-spec/batch_v1.json +++ b/api/swagger-spec/batch_v1.json @@ -2589,7 +2589,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/api/swagger-spec/batch_v2alpha1.json b/api/swagger-spec/batch_v2alpha1.json index e2ee18fcd11..6b1029c976c 100644 --- a/api/swagger-spec/batch_v2alpha1.json +++ b/api/swagger-spec/batch_v2alpha1.json @@ -3670,7 +3670,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/api/swagger-spec/extensions_v1beta1.json b/api/swagger-spec/extensions_v1beta1.json index 384c198a2be..c5146f53e5a 100644 --- a/api/swagger-spec/extensions_v1beta1.json +++ b/api/swagger-spec/extensions_v1beta1.json @@ -8314,7 +8314,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 84fa6877150..3df69b91c8c 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -20159,7 +20159,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/docs/api-reference/apps/v1beta1/definitions.html b/docs/api-reference/apps/v1beta1/definitions.html index 6b682a60b2d..d6ad36f2ccc 100755 --- a/docs/api-reference/apps/v1beta1/definitions.html +++ b/docs/api-reference/apps/v1beta1/definitions.html @@ -5373,7 +5373,7 @@ Examples:

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -6807,7 +6807,7 @@ Examples:
diff --git a/docs/api-reference/batch/v1/definitions.html b/docs/api-reference/batch/v1/definitions.html index 45d334c5374..87d0ab9e73f 100755 --- a/docs/api-reference/batch/v1/definitions.html +++ b/docs/api-reference/batch/v1/definitions.html @@ -4337,7 +4337,7 @@ Examples:

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -5788,7 +5788,7 @@ Examples:
diff --git a/docs/api-reference/batch/v2alpha1/definitions.html b/docs/api-reference/batch/v2alpha1/definitions.html index 08849bb0bb4..0134798c533 100755 --- a/docs/api-reference/batch/v2alpha1/definitions.html +++ b/docs/api-reference/batch/v2alpha1/definitions.html @@ -4344,7 +4344,7 @@ Examples:

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -5884,7 +5884,7 @@ Examples:
diff --git a/docs/api-reference/extensions/v1beta1/definitions.html b/docs/api-reference/extensions/v1beta1/definitions.html index 23d0c2eaab7..4d2e0d06896 100755 --- a/docs/api-reference/extensions/v1beta1/definitions.html +++ b/docs/api-reference/extensions/v1beta1/definitions.html @@ -6242,7 +6242,7 @@ Both these may change in the future. Incoming requests are matched against the h

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -8224,7 +8224,7 @@ Both these may change in the future. Incoming requests are matched against the h diff --git a/docs/api-reference/v1/definitions.html b/docs/api-reference/v1/definitions.html index f3c19db96cd..9d5bf98e4d9 100755 --- a/docs/api-reference/v1/definitions.html +++ b/docs/api-reference/v1/definitions.html @@ -7104,7 +7104,7 @@ Examples:

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -10250,7 +10250,7 @@ Examples:
diff --git a/federation/apis/openapi-spec/swagger.json b/federation/apis/openapi-spec/swagger.json index 9816f968887..382c8c5d637 100644 --- a/federation/apis/openapi-spec/swagger.json +++ b/federation/apis/openapi-spec/swagger.json @@ -10778,7 +10778,8 @@ "io.k8s.kubernetes.pkg.api.v1.Container": { "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "args": { diff --git a/federation/apis/swagger-spec/extensions_v1beta1.json b/federation/apis/swagger-spec/extensions_v1beta1.json index 4e6ea69e4aa..94270932c95 100644 --- a/federation/apis/swagger-spec/extensions_v1beta1.json +++ b/federation/apis/swagger-spec/extensions_v1beta1.json @@ -6058,7 +6058,8 @@ "id": "v1.Container", "description": "A single application container that you want to run within a pod.", "required": [ - "name" + "name", + "image" ], "properties": { "name": { diff --git a/federation/docs/api-reference/extensions/v1beta1/definitions.html b/federation/docs/api-reference/extensions/v1beta1/definitions.html index 555cde5f613..09ff76fffad 100755 --- a/federation/docs/api-reference/extensions/v1beta1/definitions.html +++ b/federation/docs/api-reference/extensions/v1beta1/definitions.html @@ -5664,7 +5664,7 @@ Both these may change in the future. Incoming requests are matched against the h

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

-

false

+

true

string

@@ -7294,7 +7294,7 @@ Both these may change in the future. Incoming requests are matched against the h diff --git a/pkg/api/v1/generated.proto b/pkg/api/v1/generated.proto index d7eee2b5282..c022cb1ba1e 100644 --- a/pkg/api/v1/generated.proto +++ b/pkg/api/v1/generated.proto @@ -379,7 +379,6 @@ message Container { // Docker image name. // More info: https://kubernetes.io/docs/concepts/containers/images - // +optional optional string image = 2; // Entrypoint array. Not executed within a shell. diff --git a/pkg/api/v1/types.generated.go b/pkg/api/v1/types.generated.go index 9cfb050a47b..dc5ef1f52d7 100644 --- a/pkg/api/v1/types.generated.go +++ b/pkg/api/v1/types.generated.go @@ -28258,7 +28258,6 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [20]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[1] = x.Image != "" yyq2[2] = len(x.Command) != 0 yyq2[3] = len(x.Args) != 0 yyq2[4] = x.WorkingDir != "" @@ -28281,7 +28280,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { r.EncodeArrayStart(20) } else { - yynn2 = 1 + yynn2 = 2 for _, b := range yyq2 { if b { yynn2++ @@ -28311,27 +28310,21 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } + yym7 := z.EncBinary() + _ = yym7 + if false { } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("image")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("image")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } if yyr2 || yy2arr2 { From 4250c5d3f43bfcf6197c7361dac483a677c22d3d Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Sat, 10 Jun 2017 02:56:19 -0400 Subject: [PATCH 3/3] Update client-go. --- .../client-go/pkg/api/v1/generated.proto | 1 - .../client-go/pkg/api/v1/types.generated.go | 33 ++++++++----------- .../src/k8s.io/client-go/pkg/api/v1/types.go | 3 +- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto b/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto index bfa670b65d1..416bd8b250a 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto @@ -379,7 +379,6 @@ message Container { // Docker image name. // More info: https://kubernetes.io/docs/concepts/containers/images - // +optional optional string image = 2; // Entrypoint array. Not executed within a shell. diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types.generated.go b/staging/src/k8s.io/client-go/pkg/api/v1/types.generated.go index 9cfb050a47b..dc5ef1f52d7 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/types.generated.go @@ -28258,7 +28258,6 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [20]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[1] = x.Image != "" yyq2[2] = len(x.Command) != 0 yyq2[3] = len(x.Args) != 0 yyq2[4] = x.WorkingDir != "" @@ -28281,7 +28280,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { r.EncodeArrayStart(20) } else { - yynn2 = 1 + yynn2 = 2 for _, b := range yyq2 { if b { yynn2++ @@ -28311,27 +28310,21 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } + yym7 := z.EncBinary() + _ = yym7 + if false { } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("image")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("image")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } if yyr2 || yy2arr2 { diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types.go b/staging/src/k8s.io/client-go/pkg/api/v1/types.go index 04336366aa9..ee69b988b39 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/types.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/types.go @@ -1721,8 +1721,7 @@ type Container struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Docker image name. // More info: https://kubernetes.io/docs/concepts/containers/images - // +optional - Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` + Image string `json:"image" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable