// PodLabels sets the labels of Pod
327761
func (s *ServerRPC) SetPodLabels(c context.Context, req *types.PodLabelsRequest) (*types.PodLabelsResponse, error) {
	err := s.daemon.SetPodLabels(req.PodID, req.Override, req.Labels)
	if err != nil {
		return nil, err
	}

	return &types.PodLabelsResponse{}, nil
}
386093
func (s *CreateApplicationRequest) SetLabels(v []*string) *CreateApplicationRequest {
	s.Labels = v
	return s
}
196388
func WithLabels(labels map[string]string) Opt {
	return func(c *Config) error {
		c.Labels = labels
		return nil
	}
}
1354371
func (m *KubernetesMonitor) Pod(podName string, namespace string) (*api.Pod, error) {
	targetPod, err := m.kubeClient.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{})
	if err != nil {
		return nil, fmt.Errorf("error getting Kubernetes labels & IP for pod %v : %v ", podName, err)
	}
	return targetPod, nil
}
382699
func (o *GetIdentityParams) WithLabels(labels models.Labels) *GetIdentityParams {
	o.SetLabels(labels)
	return o
}
457611
func (s *StoreToPodLister) Pods(namespace string) storePodsNamespacer {
	return storePodsNamespacer{s.Store, namespace}
}
951413
func (rp *Ringpop) Labels() (*swim.NodeLabels, error) {
	if !rp.Ready() {
		return nil, ErrNotBootstrapped
	}

	return rp.node.Labels(), nil
}
672426
func (s *GetApplicationOutput) SetLabels(v []*string) *GetApplicationOutput {
	s.Labels = v
	return s
}
240141
func (s *ContainerDefinition) SetDockerLabels(v map[string]*string) *ContainerDefinition {
	s.DockerLabels = v
	return s
}
300457
func (s *UpdateApplicationOutput) SetLabels(v []*string) *UpdateApplicationOutput {
	s.Labels = v
	return s
}
1094286
func (m *MockCoreV1Interface) Pods(arg0 string) v11.PodInterface {
	ret := m.ctrl.Call(m, "Pods", arg0)
	ret0, _ := ret[0].(v11.PodInterface)
	return ret0
}
924637
func (s *podPresetLister) PodPresets(namespace string) PodPresetNamespaceLister {
	return podPresetNamespaceLister{indexer: s.indexer, namespace: namespace}
}
836990
func (m *Client) WatchPods(labels map[string]string) (watch.Watch, error) {
	w := &mockWatcher{
		results: make(chan watch.Event),
		stop:    make(chan bool),
	}

	i := len(m.watchers) // length of watchers is current index
	m.watchers = append(m.watchers, w)

	go func() {
		<-w.stop
		m.watchers = append(m.watchers[:i], m.watchers[i+1:]...)
	}()

	return w, nil
}
109571
func (c *APIClient) fetchPodLabels(ns, name string) error {
	var data interface{}

	// initiate a get request to the api server
	podURL := c.baseURL + ns + "/pods/" + name
	req, err := http.NewRequest("GET", podURL, nil)
	if err != nil {
		return err
	}
	if len(strings.TrimSpace(c.authToken)) > 0 {
		req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.authToken))
	}
	r, err := c.client.Do(req)
	if err != nil {
		return err
	}

	defer r.Body.Close()
	switch {
	case r.StatusCode == int(404):
		return fmt.Errorf("page not found")
	case r.StatusCode == int(403):
		return fmt.Errorf("access denied")
	case r.StatusCode != int(200):
		log.Errorf("GET Status '%s' status code %d \n", r.Status, r.StatusCode)
		return fmt.Errorf("%s", r.Status)
	}

	response, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return err
	}

	err = json.Unmarshal(response, &data)
	if err != nil {
		return err
	}

	podSpec := data.(map[string]interface{})
	m, ok := podSpec["metadata"]
	// Treat missing metadata as a fatal error
	if !ok {
		return fmt.Errorf("metadata not found in podSpec")
	}

	p := &c.podCache
	p.labelsMutex.Lock()
	defer p.labelsMutex.Unlock()
	p.setDefaults(ns, name)

	meta := m.(map[string]interface{})
	l, ok := meta["labels"]
	if ok {
		labels := l.(map[string]interface{})
		for key, val := range labels {
			switch valType := val.(type) {

			case string:
				p.labels[key] = val.(string)

			default:
				log.Infof("Label %s type %v in pod %s.%s ignored",
					key, valType, ns, name)
			}
		}
	} else {
		log.Infof("labels not found in podSpec metadata, using defaults")
	}

	return nil
}
886637
func (s *UpdateDeviceInstanceInput) SetLabels(v []*string) *UpdateDeviceInstanceInput {
	s.Labels = v
	return s
}
464085
func (v *version) PodPresets() PodPresetInformer {
	return &podPresetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
580952
func (s *UpdateApplicationRequest) SetLabels(v []*string) *UpdateApplicationRequest {
	s.Labels = v
	return s
}