From 10117cc8157719f7d68edf5c8f471ca86c3c3b50 Mon Sep 17 00:00:00 2001 From: Ashley Reese Date: Tue, 3 Jan 2017 13:53:11 +0100 Subject: [PATCH] Validate unique host ports with host IPs as well --- pkg/api/validation/validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 22abd7b5ce2..df13b9905dd 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -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 {