Skip to content

Commit

Permalink
[api-gateway]: Support http, https and www-http as AppProtocol in kub…
Browse files Browse the repository at this point in the history
…ernetes' service

Fix #6560
  • Loading branch information
Krast76 committed Aug 18, 2024
1 parent f9b6f6f commit 23dd9c2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/dag/accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,21 @@ func validateExternalName(svc *core_v1.Service, enableExternalNameSvc bool) erro

// the ServicePort's AppProtocol must be one of the these.
const (
protoK8sH2C = "kubernetes.io/h2c"
protoK8sWS = "kubernetes.io/ws"
protoK8sH2C = "kubernetes.io/h2c"
protoK8sWS = "kubernetes.io/ws"
protoHttp = "www-http"
protoHttps = "https"
protoWebHttp = "http"
)

func toContourProtocol(appProtocol string) (string, bool) {
proto, ok := map[string]string{
// *NOTE: for gateway-api: the websocket is enabled by default
protoK8sWS: "",
protoK8sH2C: "h2c",
protoK8sWS: "",
protoK8sH2C: "h2c",
protoHttp: "",
protoHttps: "tls",
protoWebHttp: "",
}[appProtocol]
return proto, ok
}
Expand Down

0 comments on commit 23dd9c2

Please sign in to comment.