func (k *kubeEndpointsConfigProvider) Collect(ctx context.Context) ([]integration.Config, error) {
	services, err := k.serviceLister.List(labels.Everything())
	if err != nil {
		return nil, err
	}
	k.setUpToDate(true)

	var generatedConfigs []integration.Config
	parsedConfigsInfo := parseServiceAnnotationsForEndpoints(services)
	for _, config := range parsedConfigsInfo {
		kep, err := k.endpointsLister.Endpoints(config.namespace).Get(config.name)
		if err != nil {
			log.Errorf("Cannot get Kubernetes endpoints: %s", err)
			continue
		}
		generatedConfigs = append(generatedConfigs, generateConfigs(config.tpl, config.resolveMode, kep)...)
		endpointsID := apiserver.EntityForEndpoints(config.namespace, config.name, "")
		k.Lock()
		k.monitoredEndpoints[endpointsID] = true
		k.Unlock()
	}
	return generatedConfigs, nil
}
// Collect retrieves services from the apiserver, builds Config objects and returns them
Collect retrieves services from the apiserver, builds Config objects and returns them
// Collect retrieves services from the apiserver builds Config objects and returns them
func (k *kubeEndpointsConfigProvider) Collect(ctx context.Context) ([]integration.Config, error) {
	services, err := k.serviceLister.List(labels.Everything())
	if err != nil {
		return nil, err
	}
	k.setUpToDate(true)
	var generatedConfigs []integration.Config
	parsedConfigsInfo := parseServiceAnnotationsForEndpoints(services)
	for _, config := range parsedConfigsInfo {
		kep, err := k.endpointsLister.Endpoints(config.namespace).Get(config.name)
		if err != nil {
			log.Errorf("Cannot get Kubernetes endpoints: %s", err)
			continue
		}
		generatedConfigs = append(generatedConfigs, generateConfigs(config.tpl, config.resolveMode, kep)...)
		endpointsID := apiserver.EntityForEndpoints(config.namespace, config.name, "")
		k.Lock()
		k.monitoredEndpoints[endpointsID] = true
		k.Unlock()
	}
	return generatedConfigs, nil
}
func ( k * kubeEndpointsConfigProvider ) Collect ( ctx context . Context ) ( [ ] integration . Config , error ) { services , err := k . serviceLister . List ( labels . Everything ( ) ) if err != nil { return nil , err } k . setUpToDate ( true ) var generatedConfigs [ ] integration . Config parsedConfigsInfo := parseServiceAnnotationsForEndpoints ( services ) for _ , config := range parsedConfigsInfo { kep , err := k . endpointsLister . Endpoints ( config . namespace ) . Get ( config . name ) if err != nil { log . Errorf ( " " , err ) continue } generatedConfigs = append ( generatedConfigs , generateConfigs ( config . tpl , config . resolveMode , kep ) ... ) endpointsID := apiserver . EntityForEndpoints ( config . namespace , config . name , " " ) k . Lock ( ) k . monitoredEndpoints [ endpointsID ] = true k . Unlock ( ) } return generatedConfigs , nil }
Collect retrieves services from the apiserver, builds Config objects and returns them
Collect retrieves services from the apiserver builds Config objects and returns them