kubernetes/pkg/api/validation
Kubernetes Submit Queue 9dec47dc28 Merge pull request #39369 from CallMeFoxie/validation-hostip
Automatic merge from submit-queue (batch tested with PRs 40971, 41027, 40709, 40903, 39369)

Validate unique  against HostPort/Protocol/HostIP

**What this PR does / why we need it**:
We can bind to specific IPs however validation will fail for different HostIP:HostPort combination. This is a small fix to check combination of HostPort/Protocol/HostIP rather than just HostPort/Protocol.

Sample configuration
...
"ports": [
              {
                "protocol": "TCP",
                "containerPort": 53,
                "hostPort": 55,
                "hostIP": "127.0.0.1",
                "name": "dns-local-tcp"
              },
              {
                "protocol": "TCP",
                "containerPort": 53,
                "hostPort": 55,
                "hostIP": "127.0.0.2",
                "name": "dns-local-tcp2"
              }
]

Before:
* spec.template.spec.containers[1].ports[2].hostPort: Duplicate value: "55/TCP"
* spec.template.spec.containers[1].ports[3].hostPort: Duplicate value: "55/TCP"

After applying the patch:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:55            0.0.0.0:*               LISTEN      3644/docker-proxy
tcp        0      0 127.0.0.2:55            0.0.0.0:*               LISTEN      3629/docker-proxy

Thanks
Ashley

**Release note**:

```release-note
```
2017-02-06 20:57:18 -08:00
..
testdata/v1 Check for an empty value in validateField 2016-05-30 14:12:18 +10:00
BUILD move genericvalidation to apimachinery 2017-02-02 07:37:00 -05:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
events_test.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
events.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
OWNERS Updated top level owners file to match new format 2017-01-19 11:29:16 -08:00
schema_test.go pkg/api/testing: cut off fuzzers from static codecs 2017-02-02 06:58:28 +01:00
schema.go Improve error messages for ValidateObject method. 2017-01-24 09:12:06 +08:00
validation_test.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
validation.go Merge pull request #39369 from CallMeFoxie/validation-hostip 2017-02-06 20:57:18 -08:00