func (p *PrometheusPodsConfigProvider) Collect(ctx context.Context) ([]integration.Config, error) {
	var err error
	if p.kubelet == nil {
		p.kubelet, err = kubelet.GetKubeUtil()
		if err != nil {
			return []integration.Config{}, err
		}
	}

	pods, err := p.kubelet.GetLocalPodList(ctx)
	if err != nil {
		return []integration.Config{}, err
	}

	return p.parsePodlist(pods), nil
}
// Collect retrieves templates from the kubelet's podlist, builds config objects and returns them
Collect retrieves templates from the kubelet's podlist, builds config objects and returns them
// Collect retrieves templates from the kubelet ' s podlist builds config objects and returns them
func (p *PrometheusPodsConfigProvider) Collect(ctx context.Context) ([]integration.Config, error) {
	var err error
	if p.kubelet == nil {
		p.kubelet, err = kubelet.GetKubeUtil()
		if err != nil {
			return []integration.Config{}, err
		}
	}
	pods, err := p.kubelet.GetLocalPodList(ctx)
	if err != nil {
		return []integration.Config{}, err
	}
	return p.parsePodlist(pods), nil
}
func ( p * PrometheusPodsConfigProvider ) Collect ( ctx context . Context ) ( [ ] integration . Config , error ) { var err error if p . kubelet == nil { p . kubelet , err = kubelet . GetKubeUtil ( ) if err != nil { return [ ] integration . Config { } , err } } pods , err := p . kubelet . GetLocalPodList ( ctx ) if err != nil { return [ ] integration . Config { } , err } return p . parsePodlist ( pods ) , nil }
Collect retrieves templates from the kubelet's podlist, builds config objects and returns them
Collect retrieves templates from the kubelet ' s podlist builds config objects and returns them