Revert "use keys (#2167)" (#2188)

This reverts commit 974ed086f2.
This commit is contained in:
Miek Gieben 2018-10-11 21:59:50 +01:00 committed by Chris O'Haver
parent c8fb66f8cc
commit 6ed88fab74
13 changed files with 380 additions and 291 deletions

View file

@ -40,7 +40,7 @@ type EndpointPort struct {
}
// EndpointsKey return a string using for the index.
func EndpointsKey(namespace, name string) string { return namespace + "/" + name }
func EndpointsKey(name, namespace string) string { return name + "." + namespace }
// ToEndpoints converts an api.Service to a *Service.
func ToEndpoints(obj interface{}) interface{} {
@ -61,7 +61,7 @@ func ToEndpoints(obj interface{}) interface{} {
Addresses: make([]EndpointAddress, len(eps.Addresses)),
}
if len(eps.Ports) == 0 {
// Add sentinel if there are no ports.
// Add sentinal if there are no ports.
sub.Ports = []EndpointPort{{Port: -1}}
} else {
sub.Ports = make([]EndpointPort, len(eps.Ports))