mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-23 10:58:42 +00:00
fix 104329: check for headless before trying to release the ClusterIPs
This commit is contained in:
@@ -759,6 +759,12 @@ func (rs *REST) handleClusterIPsForUpdatedService(oldService *api.Service, servi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CASE B:
|
// CASE B:
|
||||||
|
|
||||||
|
// if headless service then we bail out early (no clusterIPs management needed)
|
||||||
|
if len(oldService.Spec.ClusterIPs) > 0 && oldService.Spec.ClusterIPs[0] == api.ClusterIPNone {
|
||||||
|
return nil, nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Update service from non-ExternalName to ExternalName, should release ClusterIP if exists.
|
// Update service from non-ExternalName to ExternalName, should release ClusterIP if exists.
|
||||||
if oldService.Spec.Type != api.ServiceTypeExternalName && service.Spec.Type == api.ServiceTypeExternalName {
|
if oldService.Spec.Type != api.ServiceTypeExternalName && service.Spec.Type == api.ServiceTypeExternalName {
|
||||||
toRelease = make(map[api.IPFamily]string)
|
toRelease = make(map[api.IPFamily]string)
|
||||||
@@ -775,11 +781,6 @@ func (rs *REST) handleClusterIPsForUpdatedService(oldService *api.Service, servi
|
|||||||
return nil, toRelease, nil
|
return nil, toRelease, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// if headless service then we bail out early (no clusterIPs management needed)
|
|
||||||
if len(oldService.Spec.ClusterIPs) > 0 && oldService.Spec.ClusterIPs[0] == api.ClusterIPNone {
|
|
||||||
return nil, nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// upgrade and downgrade are specific to dualstack
|
// upgrade and downgrade are specific to dualstack
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) {
|
if !utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) {
|
||||||
return nil, nil, nil
|
return nil, nil, nil
|
||||||
|
Reference in New Issue
Block a user