Merge pull request #44487 from resouer/fix-ss-error

Automatic merge from submit-queue (batch tested with PRs 41498, 44487)

Use len of pods in stateful set error

**What this PR does / why we need it**:
Sync stateful set reports wrong error, we need to fix it.

**Release note**:

```release-note
`NONE`
```
This commit is contained in:
Kubernetes Submit Queue 2017-04-21 01:55:57 -07:00 committed by GitHub
commit cd37aaafb3

View File

@ -416,11 +416,10 @@ func (ssc *StatefulSetController) sync(key string) error {
// syncStatefulSet syncs a tuple of (statefulset, []*v1.Pod).
func (ssc *StatefulSetController) syncStatefulSet(set *apps.StatefulSet, pods []*v1.Pod) error {
glog.V(2).Infof("Syncing StatefulSet %v/%v with %d pods", set.Namespace, set.Name, len(pods))
glog.V(4).Infof("Syncing StatefulSet %v/%v with %d pods", set.Namespace, set.Name, len(pods))
if err := ssc.control.UpdateStatefulSet(set, pods); err != nil {
glog.V(2).Infof("Error syncing StatefulSet %s/%s with %d pods : %s", set.Namespace, set.Name, err)
return err
}
glog.V(2).Infof("Successfully synced StatefulSet %s/%s successful", set.Namespace, set.Name)
glog.V(4).Infof("Successfully synced StatefulSet %s/%s successful", set.Namespace, set.Name)
return nil
}