mirror of https://github.com/linkerd/linkerd2.git
Stop using "default" as default service namespace (#61)
Previously the destinations service would look for services in the "default" namespace if the service name didn't have at least two labels. However, the "default" namespace is almost always the wrong namespace. The only reasonable default namespace is the namespace of the client service, which isn't given to the destinations service. Therefore it shouldn't try to default the namespace. Accordingly, stop defaulting the namespace to "default". Validated by manually testing the emojivoto service before and after the proxy implemented namespace defaulting itself.
This commit is contained in:
parent
a8e75115ab
commit
2729fa02bc
|
@ -85,12 +85,16 @@ func (s *server) Get(dest *common.Destination, stream pb.Destination_GetServer)
|
|||
}
|
||||
// service.namespace.svc.cluster.local
|
||||
domains := strings.Split(host, ".")
|
||||
service := domains[0]
|
||||
namespace := "default"
|
||||
if len(domains) > 1 {
|
||||
namespace = domains[1]
|
||||
|
||||
if len(domains) < 2 {
|
||||
err := fmt.Errorf("not a service: %s", host)
|
||||
log.Error(err)
|
||||
return err
|
||||
}
|
||||
|
||||
service := domains[0]
|
||||
namespace := domains[1]
|
||||
|
||||
id := namespace + "/" + service
|
||||
|
||||
listener := endpointListener{stream: stream}
|
||||
|
|
Loading…
Reference in New Issue