From 75941afab276b9bcf3f2c4b3a880e9908a38e0e7 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 17 Aug 2015 15:44:37 -0700 Subject: [PATCH] Make nodePort optional in v1 API --- api/swagger-spec/v1.json | 3 +-- pkg/api/v1/types.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 437d09cfa8f..6450dd09ba7 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -13446,8 +13446,7 @@ "v1.ServicePort": { "id": "v1.ServicePort", "required": [ - "port", - "nodePort" + "port" ], "properties": { "name": { diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 40277537572..0f732ad049a 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -1178,7 +1178,7 @@ type ServicePort struct { // The port on each node on which this service is exposed. // Default is to auto-allocate a port if the ServiceType of this Service requires one. - NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed when type=NodePort or LoadBalancer; usually assigned by the system; if specified, it will be allocated to the service if unused or else creation of the service will fail; see http://releases.k8s.io/HEAD/docs/user-guide/services.md#type--nodeport"` + NodePort int `json:"nodePort,omitempty" description:"the port on each node on which this service is exposed when type=NodePort or LoadBalancer; usually assigned by the system; if specified, it will be allocated to the service if unused or else creation of the service will fail; see http://releases.k8s.io/HEAD/docs/user-guide/services.md#type--nodeport"` } // Service is a named abstraction of software service (for example, mysql) consisting of local port