Skip to content

Commit 78cb402

Browse files
fix: assign rule priority automatically to routing rule (#1390) (#1391)
* assign rule priority * skip rule with priority * adding non-working tests * find next free priority * adjust jump; fix test * remove comment * add buffer to sig channel Co-authored-by: Alex Z. Yang <[email protected]> Co-authored-by: Alex Z. Yang <[email protected]>
1 parent 0a4f032 commit 78cb402

24 files changed

+310
-9
lines changed

cmd/appgw-ingress/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func main() {
224224
klog.Fatal(errorLine)
225225
}
226226

227-
sigChan := make(chan os.Signal)
227+
sigChan := make(chan os.Signal, 1)
228228
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
229229
<-sigChan
230230

docs/setup/install-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Values:
236236
- `rbac.enabled`: Make sure to set this to true if you have a AKS cluster that is RBAC enabled.
237237
238238
Note on Identity: The `identityResourceID` and `identityClientID` are values that were created
239-
during the [Create an Identity](https://github.com/Azure/application-gateway-kubernetes-ingress/blob/072626cb4e37f7b7a1b0c4578c38d1eadc3e8701/docs/setup/install-new.md#create-an-identity)
239+
during the [Create an Identity](#create-an-identity)
240240
steps, and could be obtained again using the following command:
241241
242242
```bash

functional_tests/cookie_name.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
"httpListener": {
208208
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-e1903c8aa3446b7b3207aec6d6ecba8a"
209209
},
210+
"priority": 19500,
210211
"ruleType": "PathBasedRouting",
211212
"urlPathMap": {
212213
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-e1903c8aa3446b7b3207aec6d6ecba8a"

functional_tests/duplicate_ports.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
"httpListener": {
199199
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-08ba2bb7da9df5927d900fca8ce96ba5"
200200
},
201+
"priority": 19000,
201202
"redirectConfiguration": {
202203
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/redirectConfigurations/sslr-fl-175bc9385b96d7116527143f35cdfdea"
203204
},
@@ -217,6 +218,7 @@
217218
"httpListener": {
218219
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-175bc9385b96d7116527143f35cdfdea"
219220
},
221+
"priority": 19005,
220222
"ruleType": "Basic"
221223
}
222224
}

functional_tests/empty_cluster_with_private_ip.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"httpListener": {
117117
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-ac133916d522c571f2d9ef8f3b8a25d3"
118118
},
119+
"priority": 19500,
119120
"ruleType": "Basic"
120121
}
121122
}

functional_tests/health_probes_same_labels_different_namespaces.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
"httpListener": {
245245
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-08ba2bb7da9df5927d900fca8ce96ba5"
246246
},
247+
"priority": 19000,
247248
"ruleType": "PathBasedRouting",
248249
"urlPathMap": {
249250
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-08ba2bb7da9df5927d900fca8ce96ba5"
@@ -263,6 +264,7 @@
263264
"httpListener": {
264265
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-175bc9385b96d7116527143f35cdfdea"
265266
},
267+
"priority": 19005,
266268
"ruleType": "Basic"
267269
}
268270
}

functional_tests/one_ingress_https_backend.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
"httpListener": {
200200
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-c61dda7ff9748ec5f51989767db5afd0"
201201
},
202+
"priority": 19500,
202203
"ruleType": "PathBasedRouting",
203204
"urlPathMap": {
204205
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-c61dda7ff9748ec5f51989767db5afd0"
@@ -212,6 +213,7 @@
212213
"httpListener": {
213214
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-e1903c8aa3446b7b3207aec6d6ecba8a"
214215
},
216+
"priority": 19505,
215217
"ruleType": "PathBasedRouting",
216218
"urlPathMap": {
217219
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-e1903c8aa3446b7b3207aec6d6ecba8a"

functional_tests/one_ingress_https_backend_without_backend_protocol.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
"httpListener": {
160160
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-c61dda7ff9748ec5f51989767db5afd0"
161161
},
162+
"priority": 19500,
162163
"ruleType": "PathBasedRouting",
163164
"urlPathMap": {
164165
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-c61dda7ff9748ec5f51989767db5afd0"

functional_tests/one_ingress_slash_nothing.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"httpListener": {
163163
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-e1903c8aa3446b7b3207aec6d6ecba8a"
164164
},
165+
"priority": 19500,
165166
"ruleType": "Basic"
166167
}
167168
}

functional_tests/one_ingress_slash_slashnothing.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
"httpListener": {
203203
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/httpListeners/fl-e1903c8aa3446b7b3207aec6d6ecba8a"
204204
},
205+
"priority": 19500,
205206
"ruleType": "PathBasedRouting",
206207
"urlPathMap": {
207208
"id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/urlPathMaps/url-e1903c8aa3446b7b3207aec6d6ecba8a"

0 commit comments

Comments
 (0)