From bb7ef7b48ad26056ec8383a87070912197e7bba6 Mon Sep 17 00:00:00 2001 From: Romain Date: Fri, 21 Mar 2025 11:02:04 +0100 Subject: [PATCH] Deprecate defaultRuleSyntax and ruleSyntax options Co-authored-by: Kevin Pollet --- docs/content/migration/v3.md | 12 + .../kubernetes-crd-definition-v1.yml | 2 + .../traefik.io_ingressroutes.yaml | 1 + .../traefik.io_ingressroutetcps.yaml | 1 + .../http/router/rules-and-priority.md | 5 + .../kubernetes/ingress.md | 5 + .../other-providers/consul-catalog.md | 14 +- .../other-providers/docker.md | 14 +- .../other-providers/ecs.md | 14 +- .../other-providers/kv.md | 5 + .../other-providers/nomad.md | 14 +- .../other-providers/swarm.md | 14 +- .../routing/providers/kubernetes-ingress.md | 5 + integration/fixtures/k8s/01-traefik-crd.yml | 2 + integration/testdata/rawdata-consul.json | 4 +- integration/testdata/rawdata-etcd.json | 4 +- integration/testdata/rawdata-gateway.json | 14 +- .../rawdata-ingress-label-selector.json | 4 +- integration/testdata/rawdata-ingress.json | 4 +- .../rawdata-ingressclass-disabled.json | 4 +- .../testdata/rawdata-ingressclass.json | 4 +- integration/testdata/rawdata-redis.json | 4 +- integration/testdata/rawdata-zk.json | 4 +- pkg/cli/deprecation.go | 24 +- pkg/cli/deprecation_test.go | 9 + pkg/config/dynamic/http_config.go | 9 +- pkg/config/dynamic/tcp_config.go | 15 +- pkg/config/static/static_config.go | 2 + .../crd/traefikio/v1alpha1/ingressroute.go | 1 + .../crd/traefikio/v1alpha1/ingressroutetcp.go | 1 + pkg/provider/kubernetes/gateway/grpcroute.go | 3 +- pkg/provider/kubernetes/gateway/httproute.go | 3 +- .../kubernetes/gateway/kubernetes_test.go | 224 +++++++++--------- pkg/provider/kubernetes/gateway/tcproute.go | 2 +- pkg/provider/kubernetes/gateway/tlsroute.go | 2 +- pkg/provider/kubernetes/ingress/kubernetes.go | 5 +- .../kubernetes/ingress/kubernetes_test.go | 6 +- .../fixtures/api_insecure_with_dashboard.json | 4 +- .../api_insecure_without_dashboard.json | 2 +- .../traefik/fixtures/full_configuration.json | 12 +- .../traefik/fixtures/ping_simple.json | 2 +- .../traefik/fixtures/prometheus_simple.json | 2 +- .../traefik/fixtures/redirection.json | 2 +- .../traefik/fixtures/redirection_port.json | 2 +- .../fixtures/redirection_with_protocol.json | 2 +- .../traefik/fixtures/rest_insecure.json | 2 +- pkg/provider/traefik/internal.go | 28 ++- pkg/server/aggregator.go | 9 + 48 files changed, 333 insertions(+), 194 deletions(-) diff --git a/docs/content/migration/v3.md b/docs/content/migration/v3.md index 19a2370d5..205471d7e 100644 --- a/docs/content/migration/v3.md +++ b/docs/content/migration/v3.md @@ -238,3 +238,15 @@ spec: The `rootCAsSecrets` option, which allows only `Secrets` references, is still supported, but is now deprecated, and will be removed in the next major release. + +### Rule Syntax + +In `v3.4.0`, the `core.defaultRuleSyntax` static configuration option and the `ruleSyntax` router option have been deprecated, +and will be removed in the next major version. + +This `core.defaultRuleSyntax` option was used to switch between the v2 and v3 syntax for the router's rules, +and to help with the migration from v2 to v3. + +The `ruleSyntax` router's option was used to override the default rule syntax for a specific router. + +In preparation for the next major release, please remove any use of these two options and use the v3 syntax for writing the router's rules. diff --git a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml index 1ae793877..90a1dca49 100644 --- a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml +++ b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml @@ -314,6 +314,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. type: string required: - match @@ -565,6 +566,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax_1 + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. enum: - v3 - v2 diff --git a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml index 8fde2b818..41aa290c1 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml @@ -314,6 +314,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. type: string required: - match diff --git a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutetcps.yaml b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutetcps.yaml index da5b8725c..e9ecf6cc3 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutetcps.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutetcps.yaml @@ -164,6 +164,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax_1 + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. enum: - v3 - v2 diff --git a/docs/content/reference/routing-configuration/http/router/rules-and-priority.md b/docs/content/reference/routing-configuration/http/router/rules-and-priority.md index dc956d906..ad095da07 100644 --- a/docs/content/reference/routing-configuration/http/router/rules-and-priority.md +++ b/docs/content/reference/routing-configuration/http/router/rules-and-priority.md @@ -112,6 +112,11 @@ It only matches the request client IP and does not use the `X-Forwarded-For` hea ### RuleSyntax +!!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + In Traefik v3 a new rule syntax has been introduced ([migration guide](../../../../migration/v3.md)). the `ruleSyntax` option allows to configure the rule syntax to be used for parsing the rule on a per-router basis. This allows to have heterogeneous router configurations and ease migration. The default value of the `ruleSyntax` option is inherited from the `defaultRuleSyntax` option in the install configuration (formerly known as static configuration). By default, the `defaultRuleSyntax` static option is v3, meaning that the default rule syntax is also v3 diff --git a/docs/content/reference/routing-configuration/kubernetes/ingress.md b/docs/content/reference/routing-configuration/kubernetes/ingress.md index 8147bcacf..54bae2be3 100644 --- a/docs/content/reference/routing-configuration/kubernetes/ingress.md +++ b/docs/content/reference/routing-configuration/kubernetes/ingress.md @@ -77,6 +77,11 @@ spec: ??? info "`traefik.ingress.kubernetes.io/router.rulesyntax`" + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [rule syntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml diff --git a/docs/content/reference/routing-configuration/other-providers/consul-catalog.md b/docs/content/reference/routing-configuration/other-providers/consul-catalog.md index 83ecf7e92..534891cf3 100644 --- a/docs/content/reference/routing-configuration/other-providers/consul-catalog.md +++ b/docs/content/reference/routing-configuration/other-providers/consul-catalog.md @@ -44,7 +44,12 @@ For example, to change the rule, you could add the tag ```traefik.http.routers.m ``` ??? info "`traefik.http.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [ruleSyntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml @@ -379,7 +384,12 @@ You can declare TCP Routers, Middlewares and/or Services using tags. ``` ??? info "`traefik.tcp.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + configure the rule syntax to be used for parsing the rule on a per-router basis. ```yaml diff --git a/docs/content/reference/routing-configuration/other-providers/docker.md b/docs/content/reference/routing-configuration/other-providers/docker.md index 58444b9ad..e17c9fc91 100644 --- a/docs/content/reference/routing-configuration/other-providers/docker.md +++ b/docs/content/reference/routing-configuration/other-providers/docker.md @@ -157,7 +157,12 @@ For example, to change the rule, you could add the label ```traefik.http.routers ``` ??? info "`traefik.http.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [ruleSyntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml @@ -495,7 +500,12 @@ You can declare TCP Routers and/or Services using labels. ``` ??? info "`traefik.tcp.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + configure the rule syntax to be used for parsing the rule on a per-router basis. ```yaml diff --git a/docs/content/reference/routing-configuration/other-providers/ecs.md b/docs/content/reference/routing-configuration/other-providers/ecs.md index 8961753eb..b17d9330a 100644 --- a/docs/content/reference/routing-configuration/other-providers/ecs.md +++ b/docs/content/reference/routing-configuration/other-providers/ecs.md @@ -46,7 +46,12 @@ For example, to change the rule, you could add the label ```traefik.http.routers ``` ??? info "`traefik.http.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [ruleSyntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml @@ -379,7 +384,12 @@ You can declare TCP Routers and/or Services using labels. ``` ??? info "`traefik.tcp.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + configure the rule syntax to be used for parsing the rule on a per-router basis. ```yaml diff --git a/docs/content/reference/routing-configuration/other-providers/kv.md b/docs/content/reference/routing-configuration/other-providers/kv.md index 2d10d5a70..dc64e82f4 100644 --- a/docs/content/reference/routing-configuration/other-providers/kv.md +++ b/docs/content/reference/routing-configuration/other-providers/kv.md @@ -25,6 +25,11 @@ description: "Read the technical documentation to learn the Traefik Routing Conf ??? info "`traefik/http/routers//ruleSyntax`" + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [rule](../http/router/rules-and-priority.md#rulesyntax) for more information. | Key (Path) | Value | diff --git a/docs/content/reference/routing-configuration/other-providers/nomad.md b/docs/content/reference/routing-configuration/other-providers/nomad.md index 1e12c985c..b8cc400c9 100644 --- a/docs/content/reference/routing-configuration/other-providers/nomad.md +++ b/docs/content/reference/routing-configuration/other-providers/nomad.md @@ -44,7 +44,12 @@ For example, to change the rule, you could add the tag ```traefik.http.routers.m ``` ??? info "`traefik.http.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [ruleSyntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml @@ -371,7 +376,12 @@ You can declare TCP Routers and/or Services using tags. ``` ??? info "`traefik.tcp.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + configure the rule syntax to be used for parsing the rule on a per-router basis. ```yaml diff --git a/docs/content/reference/routing-configuration/other-providers/swarm.md b/docs/content/reference/routing-configuration/other-providers/swarm.md index f3adaae1b..51b2371c0 100644 --- a/docs/content/reference/routing-configuration/other-providers/swarm.md +++ b/docs/content/reference/routing-configuration/other-providers/swarm.md @@ -168,7 +168,12 @@ For example, to change the rule, you could add the label ```traefik.http.routers ``` ??? info "`traefik.http.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [ruleSyntax](../http/router/rules-and-priority.md#rulesyntax) for more information. ```yaml @@ -517,7 +522,12 @@ You can declare TCP Routers and/or Services using labels. ``` ??? info "`traefik.tcp.routers..ruleSyntax`" - + + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + configure the rule syntax to be used for parsing the rule on a per-router basis. ```yaml diff --git a/docs/content/routing/providers/kubernetes-ingress.md b/docs/content/routing/providers/kubernetes-ingress.md index c6cc107e9..adda4d48e 100644 --- a/docs/content/routing/providers/kubernetes-ingress.md +++ b/docs/content/routing/providers/kubernetes-ingress.md @@ -231,6 +231,11 @@ which in turn will create the resulting routers, services, handlers, etc. ??? info "`traefik.ingress.kubernetes.io/router.rulesyntax`" + !!! warning + + RuleSyntax option is deprecated and will be removed in the next major version. + Please do not use this field and rewrite the router rules to use the v3 syntax. + See [rule syntax](../routers/index.md#rulesyntax) for more information. ```yaml diff --git a/integration/fixtures/k8s/01-traefik-crd.yml b/integration/fixtures/k8s/01-traefik-crd.yml index 1ae793877..90a1dca49 100644 --- a/integration/fixtures/k8s/01-traefik-crd.yml +++ b/integration/fixtures/k8s/01-traefik-crd.yml @@ -314,6 +314,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. type: string required: - match @@ -565,6 +566,7 @@ spec: description: |- Syntax defines the router's rule syntax. More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax_1 + Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. enum: - v3 - v2 diff --git a/integration/testdata/rawdata-consul.json b/integration/testdata/rawdata-consul.json index a30995823..90806c2ac 100644 --- a/integration/testdata/rawdata-consul.json +++ b/integration/testdata/rawdata-consul.json @@ -63,7 +63,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -85,7 +85,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-etcd.json b/integration/testdata/rawdata-etcd.json index b8097ad24..f03d1b67e 100644 --- a/integration/testdata/rawdata-etcd.json +++ b/integration/testdata/rawdata-etcd.json @@ -63,7 +63,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -85,7 +85,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-gateway.json b/integration/testdata/rawdata-gateway.json index 343e5e597..b6206c121 100644 --- a/integration/testdata/rawdata-gateway.json +++ b/integration/testdata/rawdata-gateway.json @@ -6,7 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -28,7 +28,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, @@ -46,7 +46,7 @@ ], "service": "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", "rule": "Host(`foo.com`) \u0026\u0026 Path(`/bar`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 100008, "observability": { "accessLogs": true, @@ -64,7 +64,7 @@ ], "service": "httproute-default-http-app-1-gw-default-my-https-gateway-ep-websecure-0-1c0cf64bde37d9d0df06-wrr", "rule": "Host(`foo.com`) \u0026\u0026 Path(`/bar`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 100008, "tls": {}, "observability": { @@ -177,7 +177,7 @@ ], "service": "tcproute-default-tcp-app-1-gw-default-my-tcp-gateway-ep-footcp-0-e3b0c44298fc1c149afb-wrr", "rule": "HostSNI(`*`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": -1, "status": "enabled", "using": [ @@ -190,7 +190,7 @@ ], "service": "tcproute-default-tcp-app-1-gw-default-my-tls-gateway-ep-footlsterminate-0-e3b0c44298fc1c149afb-wrr", "rule": "HostSNI(`*`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": -1, "tls": { "passthrough": false @@ -206,7 +206,7 @@ ], "service": "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-footlspassthrough-0-e3b0c44298fc1c149afb-wrr", "rule": "HostSNI(`foo.bar`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 7, "tls": { "passthrough": true diff --git a/integration/testdata/rawdata-ingress-label-selector.json b/integration/testdata/rawdata-ingress-label-selector.json index 3b4203860..23305a847 100644 --- a/integration/testdata/rawdata-ingress-label-selector.json +++ b/integration/testdata/rawdata-ingress-label-selector.json @@ -6,7 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -28,7 +28,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json index a53ecd9cc..ba2ad706b 100644 --- a/integration/testdata/rawdata-ingress.json +++ b/integration/testdata/rawdata-ingress.json @@ -6,7 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -28,7 +28,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-ingressclass-disabled.json b/integration/testdata/rawdata-ingressclass-disabled.json index f5eb3a7fe..a26369282 100644 --- a/integration/testdata/rawdata-ingressclass-disabled.json +++ b/integration/testdata/rawdata-ingressclass-disabled.json @@ -6,7 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -28,7 +28,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-ingressclass.json b/integration/testdata/rawdata-ingressclass.json index 6c28ccd53..05649bfa1 100644 --- a/integration/testdata/rawdata-ingressclass.json +++ b/integration/testdata/rawdata-ingressclass.json @@ -6,7 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -28,7 +28,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-redis.json b/integration/testdata/rawdata-redis.json index 08cdac871..57c59bafb 100644 --- a/integration/testdata/rawdata-redis.json +++ b/integration/testdata/rawdata-redis.json @@ -63,7 +63,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -85,7 +85,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/integration/testdata/rawdata-zk.json b/integration/testdata/rawdata-zk.json index c4754c215..265afbdbc 100644 --- a/integration/testdata/rawdata-zk.json +++ b/integration/testdata/rawdata-zk.json @@ -63,7 +63,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806, "observability": { "accessLogs": true, @@ -85,7 +85,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805, "observability": { "accessLogs": true, diff --git a/pkg/cli/deprecation.go b/pkg/cli/deprecation.go index 422fe1434..44bd2becd 100644 --- a/pkg/cli/deprecation.go +++ b/pkg/cli/deprecation.go @@ -179,6 +179,7 @@ func findTypedField(rType reflect.Type, node *parser.Node) (reflect.StructField, // configuration holds the static configuration removed/deprecated options. type configuration struct { + Core *core `json:"core,omitempty" toml:"core,omitempty" yaml:"core,omitempty" label:"allowEmpty" file:"allowEmpty"` Experimental *experimental `json:"experimental,omitempty" toml:"experimental,omitempty" yaml:"experimental,omitempty" label:"allowEmpty" file:"allowEmpty"` Pilot map[string]any `json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty" label:"allowEmpty" file:"allowEmpty"` Providers *providers `json:"providers,omitempty" toml:"providers,omitempty" yaml:"providers,omitempty" label:"allowEmpty" file:"allowEmpty"` @@ -194,13 +195,28 @@ func (c *configuration) deprecationNotice(logger zerolog.Logger) bool { if c.Pilot != nil { incompatible = true logger.Error().Msg("Pilot configuration has been removed in v3, please remove all Pilot-related static configuration for Traefik to start." + - "For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#pilot") + " For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#pilot") } + incompatibleCore := c.Core.deprecationNotice(logger) incompatibleExperimental := c.Experimental.deprecationNotice(logger) incompatibleProviders := c.Providers.deprecationNotice(logger) incompatibleTracing := c.Tracing.deprecationNotice(logger) - return incompatible || incompatibleExperimental || incompatibleProviders || incompatibleTracing + return incompatible || incompatibleCore || incompatibleExperimental || incompatibleProviders || incompatibleTracing +} + +type core struct { + DefaultRuleSyntax string `json:"defaultRuleSyntax,omitempty" toml:"defaultRuleSyntax,omitempty" yaml:"defaultRuleSyntax,omitempty" label:"allowEmpty" file:"allowEmpty"` +} + +func (c *core) deprecationNotice(logger zerolog.Logger) bool { + if c != nil && c.DefaultRuleSyntax != "" { + logger.Error().Msg("`Core.DefaultRuleSyntax` option has been deprecated in v3.4, and will be removed in the next major version." + + " Please consider migrating all router rules to v3 syntax." + + " For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v3/#rule-syntax") + } + + return false } type providers struct { @@ -227,13 +243,13 @@ func (p *providers) deprecationNotice(logger zerolog.Logger) bool { if p.Marathon != nil { incompatible = true logger.Error().Msg("Marathon provider has been removed in v3, please remove all Marathon-related static configuration for Traefik to start." + - "For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#marathon-provider") + " For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#marathon-provider") } if p.Rancher != nil { incompatible = true logger.Error().Msg("Rancher provider has been removed in v3, please remove all Rancher-related static configuration for Traefik to start." + - "For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#rancher-v1-provider") + " For more information please read the migration guide: https://doc.traefik.io/traefik/v3.3/migration/v2-to-v3/#rancher-v1-provider") } dockerIncompatible := p.Docker.deprecationNotice(logger) diff --git a/pkg/cli/deprecation_test.go b/pkg/cli/deprecation_test.go index 556046b85..d1af48d4f 100644 --- a/pkg/cli/deprecation_test.go +++ b/pkg/cli/deprecation_test.go @@ -274,6 +274,15 @@ func TestDeprecationNotice(t *testing.T) { }, }, }, + { + desc: "Core DefaultRuleSyntax configuration is compatible", + config: configuration{ + Core: &core{ + DefaultRuleSyntax: "foobar", + }, + }, + wantCompatible: true, + }, } for _, test := range tests { diff --git a/pkg/config/dynamic/http_config.go b/pkg/config/dynamic/http_config.go index a7c927058..d91f60340 100644 --- a/pkg/config/dynamic/http_config.go +++ b/pkg/config/dynamic/http_config.go @@ -63,10 +63,11 @@ type Service struct { // Router holds the router configuration. type Router struct { - EntryPoints []string `json:"entryPoints,omitempty" toml:"entryPoints,omitempty" yaml:"entryPoints,omitempty" export:"true"` - Middlewares []string `json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` - Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` - Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` + EntryPoints []string `json:"entryPoints,omitempty" toml:"entryPoints,omitempty" yaml:"entryPoints,omitempty" export:"true"` + Middlewares []string `json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` + Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` + Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` + // Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. RuleSyntax string `json:"ruleSyntax,omitempty" toml:"ruleSyntax,omitempty" yaml:"ruleSyntax,omitempty" export:"true"` Priority int `json:"priority,omitempty" toml:"priority,omitempty,omitzero" yaml:"priority,omitempty" export:"true"` TLS *RouterTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` diff --git a/pkg/config/dynamic/tcp_config.go b/pkg/config/dynamic/tcp_config.go index de7515f5b..98629a02f 100644 --- a/pkg/config/dynamic/tcp_config.go +++ b/pkg/config/dynamic/tcp_config.go @@ -60,13 +60,14 @@ func (w *TCPWRRService) SetDefaults() { // TCPRouter holds the router configuration. type TCPRouter struct { - EntryPoints []string `json:"entryPoints,omitempty" toml:"entryPoints,omitempty" yaml:"entryPoints,omitempty" export:"true"` - Middlewares []string `json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` - Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` - Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` - RuleSyntax string `json:"ruleSyntax,omitempty" toml:"ruleSyntax,omitempty" yaml:"ruleSyntax,omitempty" export:"true"` - Priority int `json:"priority,omitempty" toml:"priority,omitempty,omitzero" yaml:"priority,omitempty" export:"true"` - TLS *RouterTCPTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` + EntryPoints []string `json:"entryPoints,omitempty" toml:"entryPoints,omitempty" yaml:"entryPoints,omitempty" export:"true"` + Middlewares []string `json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` + Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` + Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` + // Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. + RuleSyntax string `json:"ruleSyntax,omitempty" toml:"ruleSyntax,omitempty" yaml:"ruleSyntax,omitempty" export:"true"` + Priority int `json:"priority,omitempty" toml:"priority,omitempty,omitzero" yaml:"priority,omitempty" export:"true"` + TLS *RouterTCPTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go index 60c580373..af60efbb8 100644 --- a/pkg/config/static/static_config.go +++ b/pkg/config/static/static_config.go @@ -76,6 +76,7 @@ type Configuration struct { Experimental *Experimental `description:"Experimental features." json:"experimental,omitempty" toml:"experimental,omitempty" yaml:"experimental,omitempty" export:"true"` + // Deprecated: Please do not use this field. Core *Core `description:"Core controls." json:"core,omitempty" toml:"core,omitempty" yaml:"core,omitempty" export:"true"` Spiffe *SpiffeClientConfig `description:"SPIFFE integration configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" export:"true"` @@ -83,6 +84,7 @@ type Configuration struct { // Core configures Traefik core behavior. type Core struct { + // Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. DefaultRuleSyntax string `description:"Defines the rule parser default syntax (v2 or v3)" json:"defaultRuleSyntax,omitempty" toml:"defaultRuleSyntax,omitempty" yaml:"defaultRuleSyntax,omitempty"` } diff --git a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroute.go b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroute.go index 3fa3e5ef8..cfa0b0a88 100644 --- a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroute.go +++ b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroute.go @@ -37,6 +37,7 @@ type Route struct { Priority int `json:"priority,omitempty"` // Syntax defines the router's rule syntax. // More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax + // Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. Syntax string `json:"syntax,omitempty"` // Services defines the list of Service. // It can contain any combination of TraefikService and/or reference to a Kubernetes Service. diff --git a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroutetcp.go b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroutetcp.go index 40d5ac633..8d7d6b133 100644 --- a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroutetcp.go +++ b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/ingressroutetcp.go @@ -33,6 +33,7 @@ type RouteTCP struct { // Syntax defines the router's rule syntax. // More info: https://doc.traefik.io/traefik/v3.3/routing/routers/#rulesyntax_1 // +kubebuilder:validation:Enum=v3;v2 + // Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax. Syntax string `json:"syntax,omitempty"` // Services defines the list of TCP services. Services []ServiceTCP `json:"services,omitempty"` diff --git a/pkg/provider/kubernetes/gateway/grpcroute.go b/pkg/provider/kubernetes/gateway/grpcroute.go index 5529b9c07..ecf208568 100644 --- a/pkg/provider/kubernetes/gateway/grpcroute.go +++ b/pkg/provider/kubernetes/gateway/grpcroute.go @@ -131,7 +131,8 @@ func (p *Provider) loadGRPCRoute(ctx context.Context, listener gatewayListener, rule, priority := buildGRPCMatchRule(hostnames, match) router := dynamic.Router{ - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", Rule: rule, Priority: priority, EntryPoints: []string{listener.EPName}, diff --git a/pkg/provider/kubernetes/gateway/httproute.go b/pkg/provider/kubernetes/gateway/httproute.go index 2b83cb16d..8af4cadd4 100644 --- a/pkg/provider/kubernetes/gateway/httproute.go +++ b/pkg/provider/kubernetes/gateway/httproute.go @@ -128,7 +128,8 @@ func (p *Provider) loadHTTPRoute(ctx context.Context, listener gatewayListener, for _, match := range routeRule.Matches { rule, priority := buildMatchRule(hostnames, match) router := dynamic.Router{ - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", Rule: rule, Priority: priority + len(route.Spec.Rules) - ri, EntryPoints: []string{listener.EPName}, diff --git a/pkg/provider/kubernetes/gateway/kubernetes_test.go b/pkg/provider/kubernetes/gateway/kubernetes_test.go index ed516ea1b..70000cfd2 100644 --- a/pkg/provider/kubernetes/gateway/kubernetes_test.go +++ b/pkg/provider/kubernetes/gateway/kubernetes_test.go @@ -251,7 +251,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -620,7 +620,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -682,7 +682,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "api@internal", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -716,7 +716,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-websecure-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -788,7 +788,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-66e726cd8903b49727ae-wrr", Rule: "(Host(`foo.com`) || Host(`bar.com`)) && PathPrefix(`/`)", Priority: 9, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -850,7 +850,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-baa117c0219e3878749f-wrr", Rule: "(Host(`foo.com`) || HostRegexp(`^[a-z0-9-\\.]+\\.bar\\.com$`)) && PathPrefix(`/`)", Priority: 11, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -912,7 +912,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-45eba2eaf40ac792e036-wrr", Rule: "(Host(`foo.com`) || HostRegexp(`^[a-z0-9-\\.]+\\.foo\\.com$`)) && PathPrefix(`/`)", Priority: 11, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -973,14 +973,14 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100009, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", }, "httproute-default-http-app-1-gw-default-my-gateway-ep-web-1-d737b4933fa88e68ab8a": { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && Path(`/bir`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-1-d737b4933fa88e68ab8a-wrr", }, }, @@ -1069,7 +1069,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", }, }, @@ -1158,14 +1158,14 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-http-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-1-gw-default-my-gateway-https-ep-websecure-0-1c0cf64bde37d9d0df06": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-https-ep-websecure-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -1252,14 +1252,14 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-1-gw-default-my-gateway-ep-websecure-0-1c0cf64bde37d9d0df06": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-websecure-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -1340,21 +1340,21 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && (Path(`/bar`) || PathPrefix(`/bar/`)) && Header(`my-header`,`foo`) && Header(`my-header2`,`bar`)", Priority: 10610, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-6cf37fa71907768d925c-wrr", }, "httproute-default-http-app-1-gw-default-my-gateway-ep-web-2-d23f7039bc8036fb918c": { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && PathRegexp(`^/buzz/[0-9]+$`)", Priority: 11408, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-2-d23f7039bc8036fb918c-wrr", }, "httproute-default-http-app-1-gw-default-my-gateway-ep-web-1-aaba0f24fd26e1ca2276": { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && Path(`/bar`) && Header(`my-header`,`bar`)", Priority: 100109, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-1-aaba0f24fd26e1ca2276-wrr", }, }, @@ -1436,7 +1436,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && (Path(`/foo`) || PathPrefix(`/foo/`)) && Method(`GET`)", Priority: 11408, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-74ad70a7cf090becdd3c-wrr", }, }, @@ -1498,7 +1498,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Rule: "Host(`foo.com`) && (Path(`/foo`) || PathPrefix(`/foo/`)) && Query(`foo`,`bar`) && QueryRegexp(`baz`,`buz`)", Priority: 10428, - RuleSyntax: "v3", + RuleSyntax: "default", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-bb7b03c9610e982fd627-wrr", }, }, @@ -1561,7 +1561,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-web-0-efde1997778109a1f6eb-wrr", Rule: "Host(`foo.com`) && Path(`/foo`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -1623,14 +1623,14 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-web-0-efde1997778109a1f6eb-wrr", Rule: "Host(`foo.com`) && Path(`/foo`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-66f5c78d03d948e36597": { EntryPoints: []string{"web"}, Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-66f5c78d03d948e36597-wrr", Rule: "Host(`bar.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -1719,7 +1719,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-66f5c78d03d948e36597-wrr", Rule: "Host(`bar.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -1781,7 +1781,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-wrr", Rule: "Host(`example.org`) && PathPrefix(`/`)", Priority: 13, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-requestheadermodifier-0"}, }, }, @@ -1852,7 +1852,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-wrr", Rule: "Host(`example.org`) && PathPrefix(`/`)", Priority: 13, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-responseheadermodifier-0"}, }, }, @@ -1923,7 +1923,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-wrr", Rule: "Host(`example.org`) && PathPrefix(`/`)", Priority: 13, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-requestredirect-0"}, }, }, @@ -1970,7 +1970,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-wrr", Rule: "Host(`example.org`) && PathPrefix(`/`)", Priority: 13, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-364ce6ec04c3d49b19c4-requestredirect-0"}, }, }, @@ -2016,7 +2016,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-wrr", Rule: "Host(`example.com`) && (Path(`/foo`) || PathPrefix(`/foo/`))", - RuleSyntax: "v3", + RuleSyntax: "default", Priority: 10412, Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-urlrewrite-0"}, }, @@ -2085,7 +2085,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-wrr", Rule: "Host(`example.com`) && (Path(`/foo`) || PathPrefix(`/foo/`))", - RuleSyntax: "v3", + RuleSyntax: "default", Priority: 10412, Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-urlrewrite-0"}, }, @@ -2154,7 +2154,7 @@ func TestLoadHTTPRoutes(t *testing.T) { EntryPoints: []string{"web"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-wrr", Rule: "Host(`example.com`) && (Path(`/foo`) || PathPrefix(`/foo/`))", - RuleSyntax: "v3", + RuleSyntax: "default", Priority: 10412, Middlewares: []string{"httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-7f90cf546b15efadf2f8-urlrewrite-0"}, }, @@ -2226,7 +2226,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2289,7 +2289,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2361,7 +2361,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2429,7 +2429,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2488,7 +2488,7 @@ func TestLoadHTTPRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2599,7 +2599,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2649,7 +2649,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2702,7 +2702,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2753,7 +2753,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2805,7 +2805,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -2877,7 +2877,7 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) { Service: "httproute-default-http-multi-protocols-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -3024,7 +3024,7 @@ func TestLoadHTTPRoutes_filterExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{ "default-my-first-middleware", "default-my-second-middleware", @@ -3094,7 +3094,7 @@ func TestLoadHTTPRoutes_filterExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{ "default-my-first-middleware", "default-my-second-middleware", @@ -3162,7 +3162,7 @@ func TestLoadHTTPRoutes_filterExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-err-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -3212,7 +3212,7 @@ func TestLoadHTTPRoutes_filterExtensionRef(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-1c0cf64bde37d9d0df06-err-wrr", Rule: "Host(`foo.com`) && Path(`/bar`)", Priority: 100008, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -3310,7 +3310,7 @@ func TestLoadGRPCRoutes_filterExtensionRef(t *testing.T) { Service: "grpcroute-default-grpc-app-1-gw-default-my-gateway-ep-web-0-74471866db6e94e08d00-wrr", Rule: "Host(`foo.com`) && PathPrefix(`/`)", Priority: 22, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{ "default-my-first-middleware", "default-my-second-middleware", @@ -3380,7 +3380,7 @@ func TestLoadGRPCRoutes_filterExtensionRef(t *testing.T) { Service: "grpcroute-default-grpc-app-1-gw-default-my-gateway-ep-web-0-74471866db6e94e08d00-wrr", Rule: "Host(`foo.com`) && PathPrefix(`/`)", Priority: 22, - RuleSyntax: "v3", + RuleSyntax: "default", Middlewares: []string{ "default-my-first-middleware", "default-my-second-middleware", @@ -3448,7 +3448,7 @@ func TestLoadGRPCRoutes_filterExtensionRef(t *testing.T) { Service: "grpcroute-default-grpc-app-1-gw-default-my-gateway-ep-web-0-74471866db6e94e08d00-err-wrr", Rule: "Host(`foo.com`) && PathPrefix(`/`)", Priority: 22, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -3501,7 +3501,7 @@ func TestLoadGRPCRoutes_filterExtensionRef(t *testing.T) { Service: "grpcroute-default-grpc-app-1-gw-default-my-gateway-ep-web-0-74471866db6e94e08d00-err-wrr", Rule: "Host(`foo.com`) && PathPrefix(`/`)", Priority: 22, - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.Middleware{}, @@ -3744,7 +3744,7 @@ func TestLoadTCPRoutes(t *testing.T) { "tcproute-default-TCP-app-1-gw-default-my-gateway-ep-TCP-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"TCP"}, Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", Service: "tcproute-default-TCP-app-1-gw-default-my-gateway-ep-TCP-0-e3b0c44298fc1c149afb-wrr", }, }, @@ -3792,7 +3792,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -3850,13 +3850,13 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp-1"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tcp-gateway-ep-tcp-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-2-gw-default-my-tcp-gateway-ep-tcp-2-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tcp-2"}, Service: "tcproute-default-tcp-app-2-gw-default-my-tcp-gateway-ep-tcp-2-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -3936,13 +3936,13 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp-1"}, Service: "tcproute-default-tcp-app-gw-default-my-tcp-gateway-ep-tcp-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-gw-default-my-tcp-gateway-ep-tcp-1-1-e3b0c44298fc1c149afb": { EntryPoints: []string{"tcp-1"}, Service: "tcproute-default-tcp-app-gw-default-my-tcp-gateway-ep-tcp-1-1-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4020,7 +4020,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4080,7 +4080,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tls"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -4144,7 +4144,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-default-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4200,13 +4200,13 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-default-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-bar-tcp-app-bar-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tcp"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4284,7 +4284,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4341,7 +4341,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4394,7 +4394,7 @@ func TestLoadTCPRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tcp-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, }, Middlewares: map[string]*dynamic.TCPMiddleware{}, @@ -4621,7 +4621,7 @@ func TestLoadTLSRoutes(t *testing.T) { EntryPoints: []string{"TCP"}, Priority: 0, Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-TCP-0-e3b0c44298fc1c149afb-wrr", TLS: &dynamic.RouterTCPTLSConfig{}, }, @@ -4713,7 +4713,7 @@ func TestLoadTLSRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -4779,7 +4779,7 @@ func TestLoadTLSRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -4839,7 +4839,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -4899,7 +4899,7 @@ func TestLoadTLSRoutes(t *testing.T) { EntryPoints: []string{"tls"}, Service: "tcproute-default-tcp-app-1-gw-default-my-tls-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb": { @@ -4907,7 +4907,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Priority: 0, Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -4997,7 +4997,7 @@ func TestLoadTLSRoutes(t *testing.T) { EntryPoints: []string{"tls"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -5068,7 +5068,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5128,7 +5128,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5188,7 +5188,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5248,7 +5248,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`) || HostSNI(`bar.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5308,7 +5308,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 11, Rule: "HostSNI(`foo.default`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5368,7 +5368,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 11, Rule: "HostSNI(`foo.default`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5378,7 +5378,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-bar-tls-app-bar-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 7, Rule: "HostSNI(`foo.bar`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5460,7 +5460,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-bar-tls-app-bar-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Priority: 7, Rule: "HostSNI(`foo.bar`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5520,7 +5520,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-gw-default-my-gateway-ep-tcp-1-0-e3b0c44298fc1c149afb-wrr", Priority: 0, Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5530,7 +5530,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-gw-default-my-gateway-ep-tcp-1-1-e3b0c44298fc1c149afb-wrr", Priority: 0, Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5613,7 +5613,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5670,7 +5670,7 @@ func TestLoadTLSRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-tls-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Priority: 15, Rule: "HostSNI(`foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5879,13 +5879,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls-1"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb": { @@ -5893,7 +5893,7 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-1-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb-wrr", Priority: 24, Rule: "HostSNI(`pass.tls.foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -5953,14 +5953,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-1-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -6068,13 +6068,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls-1"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb": { @@ -6082,7 +6082,7 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb-wrr", Priority: 24, Rule: "HostSNI(`pass.tls.foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -6142,14 +6142,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -6229,13 +6229,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls-1"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb": { @@ -6243,7 +6243,7 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "tlsroute-default-tls-app-default-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb-wrr", Priority: 24, Rule: "HostSNI(`pass.tls.foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -6252,13 +6252,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls-1"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -6348,14 +6348,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd": { @@ -6363,14 +6363,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-bar-http-app-bar-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -6487,13 +6487,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls-1"}, Service: "tcproute-bar-tcp-app-bar-gw-default-my-gateway-ep-tls-1-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, "tlsroute-bar-tls-app-bar-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb": { @@ -6501,7 +6501,7 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "tlsroute-bar-tls-app-bar-gw-default-my-gateway-ep-tls-2-0-e3b0c44298fc1c149afb-wrr", Priority: 24, Rule: "HostSNI(`pass.tls.foo.example.com`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{ Passthrough: true, }, @@ -6561,14 +6561,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-bar-http-app-bar-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-bar-http-app-bar-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -6647,13 +6647,13 @@ func TestLoadMixedRoutes(t *testing.T) { EntryPoints: []string{"tcp"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tcp-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", }, "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb": { EntryPoints: []string{"tls"}, Service: "tcproute-default-tcp-app-default-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -6701,14 +6701,14 @@ func TestLoadMixedRoutes(t *testing.T) { Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-web-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", }, "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd": { EntryPoints: []string{"websecure"}, Service: "httproute-default-http-app-default-gw-default-my-gateway-ep-websecure-0-a431b128267aabc954fd-wrr", Rule: "PathPrefix(`/`)", Priority: 2, - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTLSConfig{}, }, }, @@ -6931,7 +6931,7 @@ func TestLoadRoutesWithReferenceGrants(t *testing.T) { EntryPoints: []string{"tls"}, Service: "tcproute-default-tcp-app-1-gw-default-my-gateway-ep-tls-0-e3b0c44298fc1c149afb-wrr", Rule: "HostSNI(`*`)", - RuleSyntax: "v3", + RuleSyntax: "default", TLS: &dynamic.RouterTCPTLSConfig{}, }, }, @@ -7079,7 +7079,7 @@ func TestLoadRoutesWithReferenceGrants(t *testing.T) { EntryPoints: []string{"http"}, Rule: "Host(`foo.example.com`) && PathPrefix(`/`)", Service: "httproute-default-http-app-1-gw-default-my-gateway-ep-http-0-d40286ed9f4652ca2108-wrr", - RuleSyntax: "v3", + RuleSyntax: "default", Priority: 17, }, }, diff --git a/pkg/provider/kubernetes/gateway/tcproute.go b/pkg/provider/kubernetes/gateway/tcproute.go index 9e302d001..74a741909 100644 --- a/pkg/provider/kubernetes/gateway/tcproute.go +++ b/pkg/provider/kubernetes/gateway/tcproute.go @@ -120,7 +120,7 @@ func (p *Provider) loadTCPRoute(listener gatewayListener, route *gatev1alpha2.TC router := dynamic.TCPRouter{ Rule: "HostSNI(`*`)", EntryPoints: []string{listener.EPName}, - RuleSyntax: "v3", + RuleSyntax: "default", } if listener.Protocol == gatev1.TLSProtocolType && listener.TLS != nil { diff --git a/pkg/provider/kubernetes/gateway/tlsroute.go b/pkg/provider/kubernetes/gateway/tlsroute.go index d481ccacd..86c93ac90 100644 --- a/pkg/provider/kubernetes/gateway/tlsroute.go +++ b/pkg/provider/kubernetes/gateway/tlsroute.go @@ -124,7 +124,7 @@ func (p *Provider) loadTLSRoute(listener gatewayListener, route *gatev1alpha2.TL rule, priority := hostSNIRule(hostnames) router := dynamic.TCPRouter{ - RuleSyntax: "v3", + RuleSyntax: "default", Rule: rule, Priority: priority, EntryPoints: []string{listener.EPName}, diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go index 819c24032..d83f29cbd 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes.go +++ b/pkg/provider/kubernetes/ingress/kubernetes.go @@ -287,8 +287,9 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl } rt := &dynamic.Router{ - Rule: "PathPrefix(`/`)", - RuleSyntax: "v3", + Rule: "PathPrefix(`/`)", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", Priority: math.MinInt32, Service: "default-backend", } diff --git a/pkg/provider/kubernetes/ingress/kubernetes_test.go b/pkg/provider/kubernetes/ingress/kubernetes_test.go index 16304b42c..f6019b63c 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes_test.go +++ b/pkg/provider/kubernetes/ingress/kubernetes_test.go @@ -540,7 +540,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Routers: map[string]*dynamic.Router{ "default-router": { Rule: "PathPrefix(`/`)", - RuleSyntax: "v3", + RuleSyntax: "default", Service: "default-backend", Priority: math.MinInt32, }, @@ -1006,7 +1006,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Routers: map[string]*dynamic.Router{ "default-router": { Rule: "PathPrefix(`/`)", - RuleSyntax: "v3", + RuleSyntax: "default", Service: "default-backend", Priority: math.MinInt32, }, @@ -1556,7 +1556,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Routers: map[string]*dynamic.Router{ "default-router": { Rule: "PathPrefix(`/`)", - RuleSyntax: "v3", + RuleSyntax: "default", Priority: math.MinInt32, Service: "default-backend", }, diff --git a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json index c46338992..5d4e1009d 100644 --- a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json +++ b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json @@ -7,7 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806 }, "dashboard": { @@ -20,7 +20,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805 } }, diff --git a/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json index 6b5928608..52323fbf1 100644 --- a/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json +++ b/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json @@ -7,7 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806 } }, diff --git a/pkg/provider/traefik/fixtures/full_configuration.json b/pkg/provider/traefik/fixtures/full_configuration.json index 24597958d..b2abc2e9f 100644 --- a/pkg/provider/traefik/fixtures/full_configuration.json +++ b/pkg/provider/traefik/fixtures/full_configuration.json @@ -7,7 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806 }, "dashboard": { @@ -20,7 +20,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775805 }, "debug": { @@ -29,7 +29,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/debug`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775806 }, "ping": { @@ -38,7 +38,7 @@ ], "service": "ping@internal", "rule": "PathPrefix(`/ping`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 }, "prometheus": { @@ -47,7 +47,7 @@ ], "service": "prometheus@internal", "rule": "PathPrefix(`/metrics`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 }, "rest": { @@ -56,7 +56,7 @@ ], "service": "rest@internal", "rule": "PathPrefix(`/api/providers`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/ping_simple.json b/pkg/provider/traefik/fixtures/ping_simple.json index 9e74ee0e3..72293a361 100644 --- a/pkg/provider/traefik/fixtures/ping_simple.json +++ b/pkg/provider/traefik/fixtures/ping_simple.json @@ -7,7 +7,7 @@ ], "service": "ping@internal", "rule": "PathPrefix(`/ping`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/prometheus_simple.json b/pkg/provider/traefik/fixtures/prometheus_simple.json index b385f6c9d..fc0ea7142 100644 --- a/pkg/provider/traefik/fixtures/prometheus_simple.json +++ b/pkg/provider/traefik/fixtures/prometheus_simple.json @@ -7,7 +7,7 @@ ], "service": "prometheus@internal", "rule": "PathPrefix(`/metrics`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/redirection.json b/pkg/provider/traefik/fixtures/redirection.json index a62480281..a3e55ab66 100644 --- a/pkg/provider/traefik/fixtures/redirection.json +++ b/pkg/provider/traefik/fixtures/redirection.json @@ -10,7 +10,7 @@ ], "service": "noop@internal", "rule": "HostRegexp(`^.+$`)", - "ruleSyntax": "v3" + "ruleSyntax": "default" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/redirection_port.json b/pkg/provider/traefik/fixtures/redirection_port.json index 05ef94a7e..d72615497 100644 --- a/pkg/provider/traefik/fixtures/redirection_port.json +++ b/pkg/provider/traefik/fixtures/redirection_port.json @@ -10,7 +10,7 @@ ], "service": "noop@internal", "rule": "HostRegexp(`^.+$`)", - "ruleSyntax": "v3" + "ruleSyntax": "default" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/redirection_with_protocol.json b/pkg/provider/traefik/fixtures/redirection_with_protocol.json index a62480281..a3e55ab66 100644 --- a/pkg/provider/traefik/fixtures/redirection_with_protocol.json +++ b/pkg/provider/traefik/fixtures/redirection_with_protocol.json @@ -10,7 +10,7 @@ ], "service": "noop@internal", "rule": "HostRegexp(`^.+$`)", - "ruleSyntax": "v3" + "ruleSyntax": "default" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/rest_insecure.json b/pkg/provider/traefik/fixtures/rest_insecure.json index a9e13e02d..c9da7d7ea 100644 --- a/pkg/provider/traefik/fixtures/rest_insecure.json +++ b/pkg/provider/traefik/fixtures/rest_insecure.json @@ -7,7 +7,7 @@ ], "service": "rest@internal", "rule": "PathPrefix(`/api/providers`)", - "ruleSyntax": "v3", + "ruleSyntax": "default", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/internal.go b/pkg/provider/traefik/internal.go index f1490a41b..22efe451d 100644 --- a/pkg/provider/traefik/internal.go +++ b/pkg/provider/traefik/internal.go @@ -117,8 +117,9 @@ func (i *Provider) acme(cfg *dynamic.Configuration) { if len(eps) > 0 { rt := &dynamic.Router{ - Rule: "PathPrefix(`/.well-known/acme-challenge/`)", - RuleSyntax: "v3", + Rule: "PathPrefix(`/.well-known/acme-challenge/`)", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", EntryPoints: eps, Service: "acme-http@internal", Priority: math.MaxInt, @@ -164,8 +165,9 @@ func (i *Provider) redirection(ctx context.Context, cfg *dynamic.Configuration) mdName := "redirect-" + rtName rt := &dynamic.Router{ - Rule: "HostRegexp(`^.+$`)", - RuleSyntax: "v3", + Rule: "HostRegexp(`^.+$`)", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", EntryPoints: []string{name}, Middlewares: []string{mdName}, Service: "noop@internal", @@ -269,7 +271,8 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "api@internal", Priority: math.MaxInt - 1, Rule: "PathPrefix(`/api`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", } if i.staticCfg.API.Dashboard { @@ -278,7 +281,8 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "dashboard@internal", Priority: math.MaxInt - 2, Rule: "PathPrefix(`/`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", Middlewares: []string{"dashboard_redirect@internal", "dashboard_stripprefix@internal"}, } @@ -300,7 +304,8 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "api@internal", Priority: math.MaxInt - 1, Rule: "PathPrefix(`/debug`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", } } } @@ -323,7 +328,8 @@ func (i *Provider) pingConfiguration(cfg *dynamic.Configuration) { Service: "ping@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/ping`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", } } @@ -341,7 +347,8 @@ func (i *Provider) restConfiguration(cfg *dynamic.Configuration) { Service: "rest@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/api/providers`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", } } @@ -359,7 +366,8 @@ func (i *Provider) prometheusConfiguration(cfg *dynamic.Configuration) { Service: "prometheus@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/metrics`)", - RuleSyntax: "v3", + // "default" stands for the default rule syntax in Traefik v3, i.e. the v3 syntax. + RuleSyntax: "default", } } diff --git a/pkg/server/aggregator.go b/pkg/server/aggregator.go index 3cd97f206..2a0c1bd4f 100644 --- a/pkg/server/aggregator.go +++ b/pkg/server/aggregator.go @@ -53,6 +53,15 @@ func mergeConfiguration(configurations dynamic.Configurations, defaultEntryPoint router.EntryPoints = defaultEntryPoints } + // The `ruleSyntax` option is deprecated. + // We exclude the "default" value to avoid logging it, + // as it is the value used for internal models and computed rules. + if router.RuleSyntax != "" && router.RuleSyntax != "default" { + log.Warn(). + Str(logs.RouterName, routerName). + Msg("Router's `ruleSyntax` option is deprecated, please remove any usage of this option.") + } + conf.HTTP.Routers[provider.MakeQualifiedName(pvd, routerName)] = router } for middlewareName, middleware := range configuration.HTTP.Middlewares {