API v1: ports are not required for all services

This commit is contained in:
Dominika Hodovska
2016-12-07 11:08:36 +01:00
parent 98a2808b94
commit cb82ef8a60
7 changed files with 28 additions and 31 deletions

View File

@@ -33967,6 +33967,7 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) {
var yyq2588 [10]bool
_, _, _ = yysep2588, yyq2588, yy2arr2588
const yyr2588 bool = false
yyq2588[0] = len(x.Ports) != 0
yyq2588[1] = len(x.Selector) != 0
yyq2588[2] = x.ClusterIP != ""
yyq2588[3] = x.Type != ""
@@ -33980,7 +33981,7 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) {
if yyr2588 || yy2arr2588 {
r.EncodeArrayStart(10)
} else {
yynn2588 = 1
yynn2588 = 0
for _, b := range yyq2588 {
if b {
yynn2588++
@@ -33991,28 +33992,34 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) {
}
if yyr2588 || yy2arr2588 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if x.Ports == nil {
r.EncodeNil()
} else {
yym2590 := z.EncBinary()
_ = yym2590
if false {
if yyq2588[0] {
if x.Ports == nil {
r.EncodeNil()
} else {
h.encSliceServicePort(([]ServicePort)(x.Ports), e)
yym2590 := z.EncBinary()
_ = yym2590
if false {
} else {
h.encSliceServicePort(([]ServicePort)(x.Ports), e)
}
}
} else {
r.EncodeNil()
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("ports"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.Ports == nil {
r.EncodeNil()
} else {
yym2591 := z.EncBinary()
_ = yym2591
if false {
if yyq2588[0] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("ports"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.Ports == nil {
r.EncodeNil()
} else {
h.encSliceServicePort(([]ServicePort)(x.Ports), e)
yym2591 := z.EncBinary()
_ = yym2591
if false {
} else {
h.encSliceServicePort(([]ServicePort)(x.Ports), e)
}
}
}
}

View File

@@ -2491,7 +2491,7 @@ type LoadBalancerIngress struct {
type ServiceSpec struct {
// The list of ports that are exposed by this service.
// More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies
Ports []ServicePort `json:"ports" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"`
Ports []ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"`
// Route service traffic to pods with label keys and values matching this
// selector. If empty or not present, the service is assumed to have an