mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user