Add appProtocol to EndpointSlice.Port

This commit is contained in:
John Howard
2019-10-16 14:48:12 -07:00
parent 077f825c58
commit d00794ca60
12 changed files with 185 additions and 49 deletions

View File

@@ -143,6 +143,12 @@ func validatePorts(endpointPorts []discovery.EndpointPort, fldPath *field.Path)
} else if !supportedPortProtocols.Has(string(*endpointPort.Protocol)) {
allErrs = append(allErrs, field.NotSupported(idxPath.Child("protocol"), *endpointPort.Protocol, supportedPortProtocols.List()))
}
if endpointPort.AppProtocol != nil {
for _, msg := range validation.IsQualifiedName(*endpointPort.AppProtocol) {
allErrs = append(allErrs, field.Invalid(idxPath.Child("appProtocol"), endpointPort.AppProtocol, msg))
}
}
}
return allErrs