External IPs support.
This commit is contained in:
@@ -2166,13 +2166,13 @@ func convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service
|
||||
}
|
||||
out.ClusterIP = in.ClusterIP
|
||||
out.Type = ServiceType(in.Type)
|
||||
if in.DeprecatedPublicIPs != nil {
|
||||
out.DeprecatedPublicIPs = make([]string, len(in.DeprecatedPublicIPs))
|
||||
for i := range in.DeprecatedPublicIPs {
|
||||
out.DeprecatedPublicIPs[i] = in.DeprecatedPublicIPs[i]
|
||||
if in.ExternalIPs != nil {
|
||||
out.ExternalIPs = make([]string, len(in.ExternalIPs))
|
||||
for i := range in.ExternalIPs {
|
||||
out.ExternalIPs[i] = in.ExternalIPs[i]
|
||||
}
|
||||
} else {
|
||||
out.DeprecatedPublicIPs = nil
|
||||
out.ExternalIPs = nil
|
||||
}
|
||||
out.SessionAffinity = ServiceAffinity(in.SessionAffinity)
|
||||
return nil
|
||||
@@ -4581,13 +4581,13 @@ func convert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.Service
|
||||
}
|
||||
out.ClusterIP = in.ClusterIP
|
||||
out.Type = api.ServiceType(in.Type)
|
||||
if in.DeprecatedPublicIPs != nil {
|
||||
out.DeprecatedPublicIPs = make([]string, len(in.DeprecatedPublicIPs))
|
||||
for i := range in.DeprecatedPublicIPs {
|
||||
out.DeprecatedPublicIPs[i] = in.DeprecatedPublicIPs[i]
|
||||
if in.ExternalIPs != nil {
|
||||
out.ExternalIPs = make([]string, len(in.ExternalIPs))
|
||||
for i := range in.ExternalIPs {
|
||||
out.ExternalIPs[i] = in.ExternalIPs[i]
|
||||
}
|
||||
} else {
|
||||
out.DeprecatedPublicIPs = nil
|
||||
out.ExternalIPs = nil
|
||||
}
|
||||
out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity)
|
||||
return nil
|
||||
|
@@ -1954,13 +1954,13 @@ func deepCopy_v1_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Clo
|
||||
}
|
||||
out.ClusterIP = in.ClusterIP
|
||||
out.Type = in.Type
|
||||
if in.DeprecatedPublicIPs != nil {
|
||||
out.DeprecatedPublicIPs = make([]string, len(in.DeprecatedPublicIPs))
|
||||
for i := range in.DeprecatedPublicIPs {
|
||||
out.DeprecatedPublicIPs[i] = in.DeprecatedPublicIPs[i]
|
||||
if in.ExternalIPs != nil {
|
||||
out.ExternalIPs = make([]string, len(in.ExternalIPs))
|
||||
for i := range in.ExternalIPs {
|
||||
out.ExternalIPs[i] = in.ExternalIPs[i]
|
||||
}
|
||||
} else {
|
||||
out.DeprecatedPublicIPs = nil
|
||||
out.ExternalIPs = nil
|
||||
}
|
||||
out.SessionAffinity = in.SessionAffinity
|
||||
return nil
|
||||
|
@@ -1150,7 +1150,7 @@ type ServiceSpec struct {
|
||||
|
||||
// Deprecated. PublicIPs are used by external load balancers, or can be set by
|
||||
// users to handle external traffic that arrives at a node.
|
||||
DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" description:"deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service"`
|
||||
ExternalIPs []string `json:"externalIPs,omitempty" description:"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; see http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies"`
|
||||
|
Reference in New Issue
Block a user