mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	exclude terminating pods (#1602)
This commit is contained in:
		
				
					committed by
					
						 Miek Gieben
						Miek Gieben
					
				
			
			
				
	
			
			
			
						parent
						
							259df3c850
						
					
				
				
					commit
					0daa03a81f
				
			| @@ -351,6 +351,11 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		// exclude pods in the process of termination | ||||
| 		if !p.ObjectMeta.DeletionTimestamp.IsZero() { | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		// check for matching ip and namespace | ||||
| 		if ip == p.Status.PodIP && match(namespace, p.Namespace) { | ||||
| 			s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user