func (strategy svcStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
	newService := obj.(*api.Service)
	oldService := old.(*api.Service)
	newService.Status = oldService.Status

	if utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) && newService.Spec.IPFamily == nil {
		if oldService.Spec.IPFamily != nil {
			newService.Spec.IPFamily = oldService.Spec.IPFamily
		} else {
			family := strategy.ipFamilies[0]
			newService.Spec.IPFamily = &family
		}
	}

	dropServiceDisabledFields(newService, oldService)
}
// PrepareForUpdate sets contextual defaults and clears fields that are not allowed to be set by end users on update.
PrepareForUpdate sets contextual defaults and clears fields that are not allowed to be set by end users on update.
// PrepareForUpdate sets contextual defaults and clears fields that are not allowed to be set by end users on update .
func (strategy svcStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
	newService := obj.(*api.Service)
	oldService := old.(*api.Service)
	newService.Status = oldService.Status
	if utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) && newService.Spec.IPFamily == nil {
		if oldService.Spec.IPFamily != nil {
			newService.Spec.IPFamily = oldService.Spec.IPFamily
		} else {
			family := strategy.ipFamilies[0]
			newService.Spec.IPFamily = &family
		}
	}
	dropServiceDisabledFields(newService, oldService)
}
func ( strategy svcStrategy ) PrepareForUpdate ( ctx context . Context , obj , old runtime . Object ) { newService := obj . ( * api . Service ) oldService := old . ( * api . Service ) newService . Status = oldService . Status if utilfeature . DefaultFeatureGate . Enabled ( features . IPv6DualStack ) && newService . Spec . IPFamily == nil { if oldService . Spec . IPFamily != nil { newService . Spec . IPFamily = oldService . Spec . IPFamily } else { family := strategy . ipFamilies [ 0 ] newService . Spec . IPFamily = & family } } dropServiceDisabledFields ( newService , oldService ) }
PrepareForUpdate sets contextual defaults and clears fields that are not allowed to be set by end users on update.
PrepareForUpdate sets contextual defaults and clears fields that are not allowed to be set by end users on update .