Commit 6d02b4e
committed
BUG/MINOR: Fix an incorrect lookup of the Endpoints corresponding to a
Service Port
When looking to the Endpoints corresponding to a service Port we used to
match the Service Port (Service.ports[].Port) against the Endpoints Port
(TargetPort) which is incorrect because they are not necessarily the
same.
An example of ServicePort config that may trigger this bug:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 80
- name: http-alt
port: 8888
protocol: TCP
targetPort: 8080
If an ingress rule is using the "http" service port, the controller may
pick the "http-alt" endpoints (instead of "http" ones) because http.8080
== http-atl.8080
The fix is to simply check if EndpointPort.Name == Service.ports[].Name
when looking for corresponding endpoints.1 parent 9e26246 commit 6d02b4e
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
179 | 175 | | |
180 | 176 | | |
181 | 177 | | |
| |||
0 commit comments