diff --git a/test/integration/ingress_https_test.go b/test/integration/ingress_https_test.go index d7e0822786..a23d60d936 100644 --- a/test/integration/ingress_https_test.go +++ b/test/integration/ingress_https_test.go @@ -30,8 +30,8 @@ import ( ) func TestHTTPSRedirect(t *testing.T) { - // kong does not support HTTPS redirect yet. - skipTestForExpressionRouter(t) + // Kong starts to support HTTPS redirect in expression router from 3.4.0. + RunWhenKongExpressionRouterWithVersion(t, ">=3.4.0") ctx := context.Background() t.Parallel() diff --git a/test/internal/helpers/kong.go b/test/internal/helpers/kong.go index 960e5e43ed..bb9302fd14 100644 --- a/test/internal/helpers/kong.go +++ b/test/internal/helpers/kong.go @@ -90,6 +90,20 @@ func GetKongDBMode(proxyAdminURL *url.URL, kongTestPassword string) (string, err // GetKongRouterFlavor gets router flavor of Kong using the provided Admin API URL. func GetKongRouterFlavor(proxyAdminURL *url.URL, kongTestPassword string) (string, error) { + const ( + // ExpressionRouterMinMajorVersion is the lowest major version of Kong that supports expression router. + // Kong below this version supports only "traditional" router, and does not contain "router_flavor" field in root configuration. + ExpressionRouterMinMajorVersion = 3 + ) + kongVersion, err := GetKongVersion(proxyAdminURL, kongTestPassword) + if err != nil { + return "", err + } + + if kongVersion.Major() < ExpressionRouterMinMajorVersion { + return "traditional", nil + } + jsonResp, err := GetKongRootConfig(proxyAdminURL, kongTestPassword) if err != nil { return "", err