mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-03-01 05:00:41 -05:00
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
```
|
||
|---|---|---|
| .. | ||
| annotations | ||
| endpoints | ||
| errors | ||
| events | ||
| install | ||
| meta | ||
| pod | ||
| resource | ||
| service | ||
| testapi | ||
| testing | ||
| unversioned | ||
| util | ||
| v1 | ||
| validation | ||
| BUILD | ||
| conversion.go | ||
| conversion_test.go | ||
| copy_test.go | ||
| deep_copy_test.go | ||
| defaulting_test.go | ||
| defaults.go | ||
| doc.go | ||
| field_constants.go | ||
| helpers.go | ||
| helpers_test.go | ||
| json.go | ||
| meta_test.go | ||
| node_example.json | ||
| OWNERS | ||
| ref.go | ||
| ref_test.go | ||
| register.go | ||
| replication_controller_example.json | ||
| resource_helpers.go | ||
| resource_helpers_test.go | ||
| serialization_proto_test.go | ||
| serialization_test.go | ||
| types.go | ||
| unstructured_test.go | ||
| zz_generated.deepcopy.go | ||