diff --git a/integration/testdata/rawdata-consul.json b/integration/testdata/rawdata-consul.json index 0888c3af9..84132ed45 100644 --- a/integration/testdata/rawdata-consul.json +++ b/integration/testdata/rawdata-consul.json @@ -53,6 +53,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -69,6 +70,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-etcd.json b/integration/testdata/rawdata-etcd.json index 18ed673e3..ffb03d9ac 100644 --- a/integration/testdata/rawdata-etcd.json +++ b/integration/testdata/rawdata-etcd.json @@ -53,6 +53,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -69,6 +70,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-gateway.json b/integration/testdata/rawdata-gateway.json index c47960257..08bd34802 100644 --- a/integration/testdata/rawdata-gateway.json +++ b/integration/testdata/rawdata-gateway.json @@ -6,6 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -22,6 +23,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-ingress-label-selector.json b/integration/testdata/rawdata-ingress-label-selector.json index 703f6dd95..e0351ce0e 100644 --- a/integration/testdata/rawdata-ingress-label-selector.json +++ b/integration/testdata/rawdata-ingress-label-selector.json @@ -6,6 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -22,6 +23,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json index 7cd63e333..febc172d4 100644 --- a/integration/testdata/rawdata-ingress.json +++ b/integration/testdata/rawdata-ingress.json @@ -6,6 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -22,6 +23,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-ingressclass-disabled.json b/integration/testdata/rawdata-ingressclass-disabled.json index 458fc2e1b..bbf4d6141 100644 --- a/integration/testdata/rawdata-ingressclass-disabled.json +++ b/integration/testdata/rawdata-ingressclass-disabled.json @@ -6,6 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -22,6 +23,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-ingressclass.json b/integration/testdata/rawdata-ingressclass.json index 346396d6c..3fe8333e1 100644 --- a/integration/testdata/rawdata-ingressclass.json +++ b/integration/testdata/rawdata-ingressclass.json @@ -6,6 +6,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -22,6 +23,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-redis.json b/integration/testdata/rawdata-redis.json index 182276fcb..4f8e8498a 100644 --- a/integration/testdata/rawdata-redis.json +++ b/integration/testdata/rawdata-redis.json @@ -53,6 +53,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -69,6 +70,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/integration/testdata/rawdata-zk.json b/integration/testdata/rawdata-zk.json index 7381d8c27..b06c6974c 100644 --- a/integration/testdata/rawdata-zk.json +++ b/integration/testdata/rawdata-zk.json @@ -53,6 +53,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806, "status": "enabled", "using": [ @@ -69,6 +70,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805, "status": "enabled", "using": [ diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go index f3f4aa23e..9411cac6d 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes.go +++ b/pkg/provider/kubernetes/ingress/kubernetes.go @@ -277,9 +277,10 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl } rt := &dynamic.Router{ - Rule: "PathPrefix(`/`)", - Priority: math.MinInt32, - Service: "default-backend", + Rule: "PathPrefix(`/`)", + RuleSyntax: "v3", + Priority: math.MinInt32, + Service: "default-backend", } if rtConfig != nil && rtConfig.Router != nil { diff --git a/pkg/provider/kubernetes/ingress/kubernetes_test.go b/pkg/provider/kubernetes/ingress/kubernetes_test.go index 273a99260..bb2ab2d4b 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes_test.go +++ b/pkg/provider/kubernetes/ingress/kubernetes_test.go @@ -528,9 +528,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Middlewares: map[string]*dynamic.Middleware{}, Routers: map[string]*dynamic.Router{ "default-router": { - Rule: "PathPrefix(`/`)", - Service: "default-backend", - Priority: math.MinInt32, + Rule: "PathPrefix(`/`)", + RuleSyntax: "v3", + Service: "default-backend", + Priority: math.MinInt32, }, }, Services: map[string]*dynamic.Service{ @@ -993,9 +994,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Middlewares: map[string]*dynamic.Middleware{}, Routers: map[string]*dynamic.Router{ "default-router": { - Rule: "PathPrefix(`/`)", - Service: "default-backend", - Priority: math.MinInt32, + Rule: "PathPrefix(`/`)", + RuleSyntax: "v3", + Service: "default-backend", + Priority: math.MinInt32, }, }, Services: map[string]*dynamic.Service{ @@ -1469,9 +1471,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Middlewares: map[string]*dynamic.Middleware{}, Routers: map[string]*dynamic.Router{ "default-router": { - Rule: "PathPrefix(`/`)", - Priority: math.MinInt32, - Service: "default-backend", + Rule: "PathPrefix(`/`)", + RuleSyntax: "v3", + Priority: math.MinInt32, + Service: "default-backend", }, }, Services: map[string]*dynamic.Service{ diff --git a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json index 38a75d6b3..c46338992 100644 --- a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json +++ b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json @@ -7,6 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806 }, "dashboard": { @@ -19,6 +20,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "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 9a98c0a1d..6b5928608 100644 --- a/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json +++ b/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json @@ -7,6 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806 } }, diff --git a/pkg/provider/traefik/fixtures/full_configuration.json b/pkg/provider/traefik/fixtures/full_configuration.json index ed0ebfba6..24597958d 100644 --- a/pkg/provider/traefik/fixtures/full_configuration.json +++ b/pkg/provider/traefik/fixtures/full_configuration.json @@ -7,6 +7,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/api`)", + "ruleSyntax": "v3", "priority": 9223372036854775806 }, "dashboard": { @@ -19,6 +20,7 @@ ], "service": "dashboard@internal", "rule": "PathPrefix(`/`)", + "ruleSyntax": "v3", "priority": 9223372036854775805 }, "debug": { @@ -27,6 +29,7 @@ ], "service": "api@internal", "rule": "PathPrefix(`/debug`)", + "ruleSyntax": "v3", "priority": 9223372036854775806 }, "ping": { @@ -35,6 +38,7 @@ ], "service": "ping@internal", "rule": "PathPrefix(`/ping`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 }, "prometheus": { @@ -43,6 +47,7 @@ ], "service": "prometheus@internal", "rule": "PathPrefix(`/metrics`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 }, "rest": { @@ -51,6 +56,7 @@ ], "service": "rest@internal", "rule": "PathPrefix(`/api/providers`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/ping_simple.json b/pkg/provider/traefik/fixtures/ping_simple.json index 6f159dce5..9e74ee0e3 100644 --- a/pkg/provider/traefik/fixtures/ping_simple.json +++ b/pkg/provider/traefik/fixtures/ping_simple.json @@ -7,6 +7,7 @@ ], "service": "ping@internal", "rule": "PathPrefix(`/ping`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/prometheus_simple.json b/pkg/provider/traefik/fixtures/prometheus_simple.json index b636b4569..b385f6c9d 100644 --- a/pkg/provider/traefik/fixtures/prometheus_simple.json +++ b/pkg/provider/traefik/fixtures/prometheus_simple.json @@ -7,6 +7,7 @@ ], "service": "prometheus@internal", "rule": "PathPrefix(`/metrics`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/fixtures/redirection.json b/pkg/provider/traefik/fixtures/redirection.json index 73ae77db3..a62480281 100644 --- a/pkg/provider/traefik/fixtures/redirection.json +++ b/pkg/provider/traefik/fixtures/redirection.json @@ -9,7 +9,8 @@ "redirect-web-to-websecure" ], "service": "noop@internal", - "rule": "HostRegexp(`^.+$`)" + "rule": "HostRegexp(`^.+$`)", + "ruleSyntax": "v3" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/redirection_port.json b/pkg/provider/traefik/fixtures/redirection_port.json index a9e75438a..05ef94a7e 100644 --- a/pkg/provider/traefik/fixtures/redirection_port.json +++ b/pkg/provider/traefik/fixtures/redirection_port.json @@ -9,7 +9,8 @@ "redirect-web-to-443" ], "service": "noop@internal", - "rule": "HostRegexp(`^.+$`)" + "rule": "HostRegexp(`^.+$`)", + "ruleSyntax": "v3" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/redirection_with_protocol.json b/pkg/provider/traefik/fixtures/redirection_with_protocol.json index 73ae77db3..a62480281 100644 --- a/pkg/provider/traefik/fixtures/redirection_with_protocol.json +++ b/pkg/provider/traefik/fixtures/redirection_with_protocol.json @@ -9,7 +9,8 @@ "redirect-web-to-websecure" ], "service": "noop@internal", - "rule": "HostRegexp(`^.+$`)" + "rule": "HostRegexp(`^.+$`)", + "ruleSyntax": "v3" } }, "services": { diff --git a/pkg/provider/traefik/fixtures/rest_insecure.json b/pkg/provider/traefik/fixtures/rest_insecure.json index e11a84e77..a9e13e02d 100644 --- a/pkg/provider/traefik/fixtures/rest_insecure.json +++ b/pkg/provider/traefik/fixtures/rest_insecure.json @@ -7,6 +7,7 @@ ], "service": "rest@internal", "rule": "PathPrefix(`/api/providers`)", + "ruleSyntax": "v3", "priority": 9223372036854775807 } }, diff --git a/pkg/provider/traefik/internal.go b/pkg/provider/traefik/internal.go index 7a78703d0..1f1b09a52 100644 --- a/pkg/provider/traefik/internal.go +++ b/pkg/provider/traefik/internal.go @@ -106,6 +106,7 @@ func (i *Provider) acme(cfg *dynamic.Configuration) { if len(eps) > 0 { rt := &dynamic.Router{ Rule: "PathPrefix(`/.well-known/acme-challenge/`)", + RuleSyntax: "v3", EntryPoints: eps, Service: "acme-http@internal", Priority: math.MaxInt, @@ -141,6 +142,7 @@ func (i *Provider) redirection(ctx context.Context, cfg *dynamic.Configuration) rt := &dynamic.Router{ Rule: "HostRegexp(`^.+$`)", + RuleSyntax: "v3", EntryPoints: []string{name}, Middlewares: []string{mdName}, Service: "noop@internal", @@ -241,6 +243,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "api@internal", Priority: math.MaxInt - 1, Rule: "PathPrefix(`/api`)", + RuleSyntax: "v3", } if i.staticCfg.API.Dashboard { @@ -249,6 +252,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "dashboard@internal", Priority: math.MaxInt - 2, Rule: "PathPrefix(`/`)", + RuleSyntax: "v3", Middlewares: []string{"dashboard_redirect@internal", "dashboard_stripprefix@internal"}, } @@ -270,6 +274,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { Service: "api@internal", Priority: math.MaxInt - 1, Rule: "PathPrefix(`/debug`)", + RuleSyntax: "v3", } } } @@ -292,6 +297,7 @@ func (i *Provider) pingConfiguration(cfg *dynamic.Configuration) { Service: "ping@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/ping`)", + RuleSyntax: "v3", } } @@ -309,6 +315,7 @@ func (i *Provider) restConfiguration(cfg *dynamic.Configuration) { Service: "rest@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/api/providers`)", + RuleSyntax: "v3", } } @@ -326,6 +333,7 @@ func (i *Provider) prometheusConfiguration(cfg *dynamic.Configuration) { Service: "prometheus@internal", Priority: math.MaxInt, Rule: "PathPrefix(`/metrics`)", + RuleSyntax: "v3", } }