Skip to content

Commit

Permalink
Change "." to "-" in generated hostnames for routes
Browse files Browse the repository at this point in the history
if a route is named example.test the default generated hostname is

example.test-default.router.default.svc.cluster.local

This changes the default generated hostname to

example-test-default.router.default.svc.cluster.local

Bug 1414956
  • Loading branch information
JacobTanenbaum committed Feb 15, 2017
1 parent 05377d4 commit 23ce2ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/route/allocation/simple/plugin.go
Expand Up @@ -2,6 +2,7 @@ package simple

import (
"fmt"
"strings"

"github.com/golang/glog"
kvalidation "k8s.io/kubernetes/pkg/util/validation"
Expand Down Expand Up @@ -50,5 +51,5 @@ func (p *SimpleAllocationPlugin) GenerateHostname(route *routeapi.Route, shard *
if len(route.Name) == 0 || len(route.Namespace) == 0 {
return ""
}
return fmt.Sprintf("%s-%s.%s", route.Name, route.Namespace, shard.DNSSuffix)
return fmt.Sprintf("%s-%s.%s", strings.Replace(route.Name, ".", "-", -1), route.Namespace, shard.DNSSuffix)
}

0 comments on commit 23ce2ca

Please sign in to comment.