statefulset_expansion.go delete ps define
This commit is contained in:
		| @@ -40,7 +40,6 @@ type StatefulSetNamespaceListerExpansion interface{} | |||||||
| // Returns an error only if no matching StatefulSets are found. | // Returns an error only if no matching StatefulSets are found. | ||||||
| func (s *statefulSetLister) GetPodStatefulSets(pod *api.Pod) ([]*apps.StatefulSet, error) { | func (s *statefulSetLister) GetPodStatefulSets(pod *api.Pod) ([]*apps.StatefulSet, error) { | ||||||
| 	var selector labels.Selector | 	var selector labels.Selector | ||||||
| 	var ps *apps.StatefulSet |  | ||||||
|  |  | ||||||
| 	if len(pod.Labels) == 0 { | 	if len(pod.Labels) == 0 { | ||||||
| 		return nil, fmt.Errorf("no StatefulSets found for pod %v because it has no labels", pod.Name) | 		return nil, fmt.Errorf("no StatefulSets found for pod %v because it has no labels", pod.Name) | ||||||
| @@ -52,8 +51,7 @@ func (s *statefulSetLister) GetPodStatefulSets(pod *api.Pod) ([]*apps.StatefulSe | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	var psList []*apps.StatefulSet | 	var psList []*apps.StatefulSet | ||||||
| 	for i := range list { | 	for _, ps := range list { | ||||||
| 		ps = list[i] |  | ||||||
| 		if ps.Namespace != pod.Namespace { | 		if ps.Namespace != pod.Namespace { | ||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jianglingxia
					jianglingxia