Skip to content

Commit bc7f69d

Browse files
Dean-Coakleypleshakov
authored andcommitted
Fix VSR updates when namespace is set implicitly
1 parent 8097840 commit bc7f69d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/k8s/controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,13 @@ func findVirtualServersForVirtualServerRouteKey(virtualServers []*conf_v1.Virtua
13961396

13971397
for _, vs := range virtualServers {
13981398
for _, r := range vs.Spec.Routes {
1399-
if r.Route == key {
1399+
// if route is defined without a namespace, use the namespace of VirtualServer.
1400+
vsrKey := r.Route
1401+
if !strings.Contains(r.Route, "/") {
1402+
vsrKey = fmt.Sprintf("%s/%s", vs.Namespace, r.Route)
1403+
}
1404+
1405+
if vsrKey == key {
14001406
result = append(result, vs)
14011407
break
14021408
}

0 commit comments

Comments
 (0)