Validate unique host ports with host IPs as well
This commit is contained in:
@@ -1546,7 +1546,7 @@ func AccumulateUniqueHostPorts(containers []api.Container, accumulator *sets.Str
|
||||
if port == 0 {
|
||||
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) {
|
||||
allErrs = append(allErrs, field.Duplicate(idxPath.Child("hostPort"), str))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user