From 5dc3b8e63bffc326e308990ae315de085c2d17d3 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 19 Oct 2018 13:52:25 -0700 Subject: [PATCH 1/2] fix container port to key by both port and protocol --- staging/src/k8s.io/api/core/v1/types.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 475e9d0137b..0dfd9021684 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -2060,6 +2060,9 @@ type Container struct { // +optional // +patchMergeKey=containerPort // +patchStrategy=merge + // +listType=map + // +listMapKey=containerPort + // +listMapKey=protocol Ports []ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` // List of sources to populate environment variables in the container. // The keys defined within a source must be a C_IDENTIFIER. All invalid keys From fdd502c2ff4d358365be6beaf89159e7e00cddbe Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Mon, 22 Oct 2018 14:12:11 -0700 Subject: [PATCH 2/2] generated files --- api/openapi-spec/swagger.json | 5 +++++ staging/src/k8s.io/api/core/v1/generated.proto | 3 +++ 2 files changed, 8 insertions(+) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index a6defd83d53..f843d034829 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -83373,6 +83373,11 @@ "items": { "$ref": "#/definitions/io.k8s.api.core.v1.ContainerPort" }, + "x-kubernetes-list-map-keys": [ + "containerPort", + "protocol" + ], + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, diff --git a/staging/src/k8s.io/api/core/v1/generated.proto b/staging/src/k8s.io/api/core/v1/generated.proto index fa32f76f7bd..cd1cf67aa8e 100644 --- a/staging/src/k8s.io/api/core/v1/generated.proto +++ b/staging/src/k8s.io/api/core/v1/generated.proto @@ -606,6 +606,9 @@ message Container { // +optional // +patchMergeKey=containerPort // +patchStrategy=merge + // +listType=map + // +listMapKey=containerPort + // +listMapKey=protocol repeated ContainerPort ports = 6; // List of sources to populate environment variables in the container.