mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
API warn non-ExternalName services w/ externalName
This commit is contained in:
@@ -56,6 +56,9 @@ func GetWarningsForService(service, oldService *api.Service) []string {
|
||||
if service.Spec.Type == api.ServiceTypeExternalName && len(service.Spec.ExternalIPs) > 0 {
|
||||
warnings = append(warnings, fmt.Sprintf("spec.externalIPs is ignored when spec.type is %q", api.ServiceTypeExternalName))
|
||||
}
|
||||
if service.Spec.Type != api.ServiceTypeExternalName && service.Spec.ExternalName != "" {
|
||||
warnings = append(warnings, fmt.Sprintf("spec.externalName is ignored when spec.type is not %q", api.ServiceTypeExternalName))
|
||||
}
|
||||
|
||||
return warnings
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user