discovery/kubernetes/service.go
func (s *Service) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
	defer s.queue.ShutDown()

	if !cache.WaitForCacheSync(ctx.Done(), s.informer.HasSynced) {
		level.Error(s.logger).Log("msg", "service informer unable to sync cache")
		return
	}

	go func() {
		for s.process(ctx, ch) {
		}
	}()

	// Block until the target provider is explicitly canceled.
	<-ctx.Done()
}
func (s *Service) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
	defer s.queue.ShutDown()

	if !cache.WaitForCacheSync(ctx.Done(), s.informer.HasSynced) {
		level.Error(s.logger).Log("msg", "service informer unable to sync cache")
		return
	}

	go func() {
		for s.process(ctx, ch) {
		}
	}()

	// Block until the target provider is explicitly canceled.
	<-ctx.Done()
}
func ( s * Service ) Run ( ctx context . Context , ch chan <- [ ] * targetgroup . Group ) { defer s . queue . ShutDown ( ) if ! cache . WaitForCacheSync ( ctx . Done ( ) , s . informer . HasSynced ) { level . Error ( s . logger ) . Log ( " " , " " ) return } go func ( ) { for s . process ( ctx , ch ) { } } ( ) // Block until the target provider is explicitly canceled. <- ctx . Done ( ) }
// Run implements the Discoverer interface.
Run implements the Discoverer interface .