8000 fix: Correct error message on missing path in path validation by zachomedia · Pull Request #2971 · nginx/kubernetes-ingress · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Starting from Kubernetes 1.18, you can use the following new features:
The NGINX Ingress Controller imposes the following restrictions on Ingress resources:
* When defining an Ingress resource, the `host` field is required.
* The `host` value needs to be unique among all Ingress and VirtualServer resources unless the Ingress resource is a [mergeable minion](/nginx-ingress-controller/configuration/ingress-resources/cross-namespace-configuration/). See also [Handling Host and Listener Collisions](/nginx-ingress-controller/configuration/handling-host-and-listener-collisions).
* The `path` field in `spec.rules[].http.paths[]` is required.

## Advanced Configuration

Expand Down
2 changes: 1 addition & 1 deletion internal/k8s/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ func validateIngressSpec(spec *networking.IngressSpec, fieldPath *field.Path) fi
for _, path := range r.HTTP.Paths {
idxPath := idxRule.Child("http").Child("path").Index(i)

allErrs = append(allErrs, validatePath(path.Path, fieldPath)...)
allErrs = append(allErrs, validatePath(path.Path, idxPath.Child("path"))...)
allErrs = append(allErrs, validateBackend(&path.Backend, idxPath.Child("backend"))...)
}
}
Expand Down
0