mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	use keys (#2167)
This commit is contained in:
		
				
					committed by
					
						 John Belamaric
						John Belamaric
					
				
			
			
				
	
			
			
			
						parent
						
							8432f14207
						
					
				
				
					commit
					974ed086f2
				
			| @@ -40,7 +40,7 @@ type EndpointPort struct { | ||||
| } | ||||
|  | ||||
| // EndpointsKey return a string using for the index. | ||||
| func EndpointsKey(name, namespace string) string { return name + "." + namespace } | ||||
| func EndpointsKey(namespace, name string) string { return namespace + "/" + name } | ||||
|  | ||||
| // 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 sentinal if there are no ports. | ||||
| 			// Add sentinel if there are no ports. | ||||
| 			sub.Ports = []EndpointPort{{Port: -1}} | ||||
| 		} else { | ||||
| 			sub.Ports = make([]EndpointPort, len(eps.Ports)) | ||||
|   | ||||
| @@ -20,7 +20,7 @@ type Service struct { | ||||
| } | ||||
|  | ||||
| // ServiceKey return a string using for the index. | ||||
| func ServiceKey(name, namespace string) string { return name + "." + namespace } | ||||
| func ServiceKey(namespace, name string) string { return namespace + "/" + name } | ||||
|  | ||||
| // ToService converts an api.Service to a *Service. | ||||
| func ToService(obj interface{}) interface{} { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user