mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
core/v1: add comments about why Service internalTrafficPolicy is not forbidden when type is ExternalName
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
parent
99cb5d2f21
commit
5d2702b0fd
@ -4809,6 +4809,8 @@ func validateServiceInternalTrafficFieldsValue(service *core.Service) field.Erro
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) {
|
||||
if service.Spec.InternalTrafficPolicy == nil {
|
||||
// We do not forbid internalTrafficPolicy on other Service types because of historical reasons.
|
||||
// We did not check that before it went beta and we don't want to invalidate existing stored objects.
|
||||
if service.Spec.Type == core.ServiceTypeNodePort ||
|
||||
service.Spec.Type == core.ServiceTypeLoadBalancer || service.Spec.Type == core.ServiceTypeClusterIP {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("spec").Child("internalTrafficPolicy"), ""))
|
||||
|
Loading…
Reference in New Issue
Block a user