Skip to content

Commit

Permalink
Set RuleSyntax "v3" for dynamic.Router explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
HalloTschuess committed May 4, 2024
1 parent aee515b commit 8108e61
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 118 deletions.
1 change: 1 addition & 0 deletions integration/testdata/rawdata-ingress-label-selector.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"service": "default-whoami-http",
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
"ruleSyntax": "v3",
"priority": 44,
"status": "enabled",
"using": [
Expand Down
4 changes: 4 additions & 0 deletions integration/testdata/rawdata-ingress.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"service": "default-whoami-http",
"rule": "Host(`whoami.test.https`) \u0026\u0026 PathPrefix(`/whoami`)",
"ruleSyntax": "v3",
"priority": 50,
"status": "enabled",
"using": [
Expand All @@ -46,6 +47,7 @@
],
"service": "default-whoami-http",
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
"ruleSyntax": "v3",
"priority": 44,
"status": "enabled",
"using": [
Expand All @@ -58,6 +60,7 @@
],
"service": "default-whoami-80",
"rule": "Host(`whoami.test.drop`) \u0026\u0026 PathPrefix(`/drop`)",
"ruleSyntax": "v3",
"priority": 47,
"status": "enabled",
"using": [
Expand All @@ -70,6 +73,7 @@
],
"service": "default-whoami-80",
"rule": "Host(`whoami.test.keep`) \u0026\u0026 PathPrefix(`/keep`)",
"ruleSyntax": "v3",
"priority": 47,
"status": "enabled",
"using": [
Expand Down
1 change: 1 addition & 0 deletions integration/testdata/rawdata-ingressclass.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"service": "default-whoami-80",
"rule": "Host(`whoami.test.keep`) \u0026\u0026 PathPrefix(`/keep`)",
"ruleSyntax": "v3",
"priority": 47,
"status": "enabled",
"using": [
Expand Down
12 changes: 7 additions & 5 deletions pkg/provider/kubernetes/ingress/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -708,8 +709,9 @@ func loadRouter(rule netv1.IngressRule, pa netv1.HTTPIngressPath, rtConfig *Rout
}

rt := &dynamic.Router{
Rule: strings.Join(rules, " && "),
Service: serviceName,
Rule: strings.Join(rules, " && "),
RuleSyntax: "v3",
Service: serviceName,
}

if rtConfig != nil && rtConfig.Router != nil {
Expand Down

0 comments on commit 8108e61

Please sign in to comment.