Skip to content

Commit 863f435

Browse files
author
OpenShift Bot
authored
Merge pull request #12843 from marun/router-f5-compat-ingress
Merged by openshift-bot
2 parents 421e4d0 + 7ebb613 commit 863f435

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/router/controller/ingress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ func GetNameForHost(name string) string {
556556
func GetSafeRouteName(name string) string {
557557
if IsGeneratedRouteName(name) {
558558
// The name of a route generated from an ingress path will contain '/', which
559-
// isn't compatible with HAproxy.
559+
// isn't compatible with HAproxy or F5.
560560
return strings.Replace(name, "/", "_", -1)
561561
}
562562
return name

pkg/router/f5/plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"k8s.io/kubernetes/pkg/watch"
1111

1212
routeapi "github.com/openshift/origin/pkg/route/api"
13+
"github.com/openshift/origin/pkg/router/controller"
1314
"github.com/openshift/origin/pkg/util/netutils"
1415
)
1516

@@ -320,7 +321,8 @@ func (p *F5Plugin) HandleEndpoints(eventType watch.EventType,
320321
// routeName returns a string that can be used as a rule name in F5 BIG-IP and
321322
// is distinct for the given route.
322323
func routeName(route routeapi.Route) string {
323-
return fmt.Sprintf("openshift_route_%s_%s", route.Namespace, route.Name)
324+
name := controller.GetSafeRouteName(route.Name)
325+
return fmt.Sprintf("openshift_route_%s_%s", route.Namespace, name)
324326
}
325327

326328
// In order to map OpenShift routes to F5 objects, we must divide routes into

0 commit comments

Comments
 (0)