mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Create a LB for a K8S with the LB-IP provided by user.
This commit is contained in:
@@ -2172,6 +2172,7 @@ func convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*api.ServiceSpec))(in)
|
||||
}
|
||||
out.Type = ServiceType(in.Type)
|
||||
if in.Ports != nil {
|
||||
out.Ports = make([]ServicePort, len(in.Ports))
|
||||
for i := range in.Ports {
|
||||
@@ -2191,7 +2192,6 @@ func convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service
|
||||
out.Selector = nil
|
||||
}
|
||||
out.ClusterIP = in.ClusterIP
|
||||
out.Type = ServiceType(in.Type)
|
||||
if in.ExternalIPs != nil {
|
||||
out.ExternalIPs = make([]string, len(in.ExternalIPs))
|
||||
for i := range in.ExternalIPs {
|
||||
@@ -2200,6 +2200,7 @@ func convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service
|
||||
} else {
|
||||
out.ExternalIPs = nil
|
||||
}
|
||||
out.LoadBalancerIP = in.LoadBalancerIP
|
||||
out.SessionAffinity = ServiceAffinity(in.SessionAffinity)
|
||||
return nil
|
||||
}
|
||||
@@ -4603,6 +4604,7 @@ func convert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.Service
|
||||
out.ExternalIPs = nil
|
||||
}
|
||||
out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity)
|
||||
out.LoadBalancerIP = in.LoadBalancerIP
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user