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
This commit is contained in:
Kubernetes Submit Queue 2017-07-24 07:40:50 -07:00 committed by GitHub
commit 5dbef94aaf

View File

@ -40,7 +40,6 @@ type StatefulSetNamespaceListerExpansion interface{}
// Returns an error only if no matching StatefulSets are found.
func (s *statefulSetLister) GetPodStatefulSets(pod *api.Pod) ([]*apps.StatefulSet, error) {
var selector labels.Selector
var ps *apps.StatefulSet
if len(pod.Labels) == 0 {
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
for i := range list {
ps = list[i]
for _, ps := range list {
if ps.Namespace != pod.Namespace {
continue
}