mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	Watch feature (#1527)
* Add part 1 watch functionality. (squashed) * add funcs for service/endpoint fqdns * add endpoints watch * document exposed funcs * only send subset deltas * locking for watch map * tests and docs * add pod watch * remove debugs prints * feedback part 1 * add error reporting to proto * inform clients of server stop+errors * add grpc options param * use proper context * Review feedback: * Removed client (will move to another repo) * Use new log functions * Change watchChan to be for string not []string * Rework how k8s plugin stores watch tracking info to simplify * Normalize the qname on watch request * Add blank line back * Revert another spurious change * Fix tests * Add stop channel. Fix tests. Better docs for plugin interface. * fmt.Printf -> log.Warningf * Move from dnsserver to plugin/pkg/watch * gofmt * remove dead client watches * sate linter * linter omg
This commit is contained in:
		
							
								
								
									
										20
									
								
								plugin/kubernetes/watch.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								plugin/kubernetes/watch.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| package kubernetes | ||||
|  | ||||
| import ( | ||||
| 	"github.com/coredns/coredns/plugin/pkg/watch" | ||||
| ) | ||||
|  | ||||
| // SetWatchChan implements watch.Watchable | ||||
| func (k *Kubernetes) SetWatchChan(c watch.Chan) { | ||||
| 	k.APIConn.SetWatchChan(c) | ||||
| } | ||||
|  | ||||
| // Watch is called when a watch is started for a name. | ||||
| func (k *Kubernetes) Watch(qname string) error { | ||||
| 	return k.APIConn.Watch(qname) | ||||
| } | ||||
|  | ||||
| // StopWatching is called when no more watches remain for a name | ||||
| func (k *Kubernetes) StopWatching(qname string) { | ||||
| 	k.APIConn.StopWatching(qname) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user