Commit 5dbef94a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #49470 from jianglingxia/jlx72414

Automatic merge from submit-queue (batch tested with PRs 45345, 49470, 49407, 49448, 49486) statefulset_expansion.go delete ps define reopen #46157 **Release note**: ```release-note NONE
parents d286f562 c4128497
...@@ -40,7 +40,6 @@ type StatefulSetNamespaceListerExpansion interface{} ...@@ -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 ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment