Mark PublicIPs as deprecated & rename to DeprecatedPublicIPs in the latest API

We need to keep them in the API so that we can round-trip between versions.
This commit is contained in:
Justin Santa Barbara
2015-05-22 18:12:46 -04:00
parent 2197c8da5a
commit e49ad95462
16 changed files with 57 additions and 53 deletions

View File

@@ -2099,13 +2099,13 @@ func convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service
}
out.PortalIP = in.PortalIP
out.Type = ServiceType(in.Type)
if in.PublicIPs != nil {
out.PublicIPs = make([]string, len(in.PublicIPs))
for i := range in.PublicIPs {
out.PublicIPs[i] = in.PublicIPs[i]
if in.DeprecatedPublicIPs != nil {
out.DeprecatedPublicIPs = make([]string, len(in.DeprecatedPublicIPs))
for i := range in.DeprecatedPublicIPs {
out.DeprecatedPublicIPs[i] = in.DeprecatedPublicIPs[i]
}
} else {
out.PublicIPs = nil
out.DeprecatedPublicIPs = nil
}
out.SessionAffinity = ServiceAffinity(in.SessionAffinity)
return nil
@@ -4355,13 +4355,13 @@ func convert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.Service
}
out.PortalIP = in.PortalIP
out.Type = api.ServiceType(in.Type)
if in.PublicIPs != nil {
out.PublicIPs = make([]string, len(in.PublicIPs))
for i := range in.PublicIPs {
out.PublicIPs[i] = in.PublicIPs[i]
if in.DeprecatedPublicIPs != nil {
out.DeprecatedPublicIPs = make([]string, len(in.DeprecatedPublicIPs))
for i := range in.DeprecatedPublicIPs {
out.DeprecatedPublicIPs[i] = in.DeprecatedPublicIPs[i]
}
} else {
out.PublicIPs = nil
out.DeprecatedPublicIPs = nil
}
out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity)
return nil

View File

@@ -1051,9 +1051,9 @@ type ServiceSpec struct {
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
Type ServiceType `json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"`
// PublicIPs are used by external load balancers, or can be set by
// Deprecated. PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
PublicIPs []string `json:"publicIPs,omitempty" description:"externally visible IPs (e.g. load balancers) that should be proxied to this service"`
DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" description:"deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service"`
// Optional: Supports "ClientIP" and "None". Used to maintain session affinity.
SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" description:"enable client IP based session affinity; must be ClientIP or None; defaults to None"`