Add scheme to IngressRoute.

This commit is contained in:
Ludovic Fernandez 2019-07-05 17:24:04 +02:00 committed by Traefiker Bot
parent 39aae4167e
commit c39aa5e857
38 changed files with 220 additions and 120 deletions

View file

@ -278,8 +278,15 @@ func loadServers(client Client, namespace string, svc v1alpha1.Service) ([]confi
}
protocol := "http"
if port == 443 || strings.HasPrefix(portSpec.Name, "https") {
protocol = "https"
switch svc.Scheme {
case "http", "https", "h2c":
protocol = svc.Scheme
case "":
if port == 443 || strings.HasPrefix(portSpec.Name, "https") {
protocol = "https"
}
default:
return nil, fmt.Errorf("invalid scheme %q specified", svc.Scheme)
}
for _, addr := range subset.Addresses {