mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Validate unique host ports with host IPs as well
This commit is contained in:
parent
2b7899ae46
commit
10117cc815
@ -1546,7 +1546,7 @@ func AccumulateUniqueHostPorts(containers []api.Container, accumulator *sets.Str
|
|||||||
if port == 0 {
|
if port == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
str := fmt.Sprintf("%d/%s", port, ctr.Ports[pi].Protocol)
|
str := fmt.Sprintf("%s/%s/%d", ctr.Ports[pi].Protocol, ctr.Ports[pi].HostIP, port)
|
||||||
if accumulator.Has(str) {
|
if accumulator.Has(str) {
|
||||||
allErrs = append(allErrs, field.Duplicate(idxPath.Child("hostPort"), str))
|
allErrs = append(allErrs, field.Duplicate(idxPath.Child("hostPort"), str))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user