Correct Kubernetes Ingress and IngressRoute port heuristic for choosing HTTPS
This commit is contained in:
parent
5731ae7f47
commit
2895ad21f3
7 changed files with 11 additions and 9 deletions
|
@ -8,8 +8,8 @@ subsets:
|
|||
- addresses:
|
||||
- ip: 10.10.0.1
|
||||
ports:
|
||||
- port: 443
|
||||
- port: 8443
|
||||
- addresses:
|
||||
- ip: 10.21.0.1
|
||||
ports:
|
||||
- port: 443
|
||||
- port: 8443
|
||||
|
|
|
@ -7,4 +7,5 @@ metadata:
|
|||
spec:
|
||||
ports:
|
||||
- port: 443
|
||||
targetPort: 8443
|
||||
clusterIp: 10.0.0.1
|
||||
|
|
|
@ -216,7 +216,7 @@ func loadService(client Client, namespace string, backend v1beta1.IngressBackend
|
|||
}
|
||||
|
||||
protocol := "http"
|
||||
if port == 443 || strings.HasPrefix(portName, "https") {
|
||||
if portSpec.Port == 443 || strings.HasPrefix(portName, "https") {
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
|
|
|
@ -732,10 +732,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
PassHostHeader: true,
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:443",
|
||||
URL: "https://10.10.0.1:8443",
|
||||
},
|
||||
{
|
||||
URL: "https://10.21.0.1:443",
|
||||
URL: "https://10.21.0.1:8443",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue