Change:
An issue to make bot happy for When StatefulSet finds any of its pods in phase Failed it will delete it and create it again. While doing so it will emit delete+create event which is really confusing for the user as he has no idea what's happening. /sig apps

Discussion:
recorder), NewRealStatefulSetStatusUpdater(kubeClient, setInformer.Lister()), history.NewHistory(kubeClient, revInformer.Lister()), <ins> recorder, </ins> ), pvcListerSynced: pvcInformer.Informer().HasSynced, queue:           workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "statefulset"),

apps "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <ins> "k8s.io/client-go/tools/record" </ins> "k8s.io/kubernetes/pkg/controller/history" )

func NewDefaultStatefulSetControl( podControl StatefulPodControlInterface, statusUpdater StatefulSetStatusUpdaterInterface, <del> controllerHistory history.Interface) StatefulSetControlInterface { return &defaultStatefulSetControl{podControl, statusUpdater, controllerHistory} </del> <ins> controllerHistory history.Interface, recorder record.EventRecorder) StatefulSetControlInterface { return &defaultStatefulSetControl{podControl, statusUpdater, controllerHistory, recorder} </ins> } type defaultStatefulSetControl struct { podControl        StatefulPodControlInterface statusUpdater     StatefulSetStatusUpdaterInterface controllerHistory history.Interface <ins> recorder          record.EventRecorder </ins> } // UpdateStatefulSet executes the core logic loop for a stateful set, applying the predictable and

for i := range replicas { // delete and recreate failed pods if isFailed(replicas[i]) { <del> glog.V(4).Infof("StatefulSet %s/%s is recreating failed Pod %s", </del> <ins> ssc.recorder.Eventf(set, v1.EventTypeWarning, "RecreatingFailedPod", "StatefulSet %s/%s is recreating failed Pod %s", </ins> set.Namespace, set.Name, replicas[i].Name)

appslisters "k8s.io/client-go/listers/apps/v1beta1" corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" <ins> "k8s.io/client-go/tools/record" </ins> podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/history"

informerFactory := informers.NewSharedInformerFactory(client, controller.NoResyncPeriodFunc()) spc := newFakeStatefulPodControl(informerFactory.Core().V1().Pods(), informerFactory.Apps().V1beta1().StatefulSets()) ssu := newFakeStatefulSetStatusUpdater(informerFactory.Apps().V1beta1().StatefulSets()) <del> ssc := NewDefaultStatefulSetControl(spc, ssu, history.NewFakeHistory(informerFactory.Apps().V1beta1().ControllerRevisions())) </del> <ins> recorder := record.NewFakeRecorder(10) ssc := NewDefaultStatefulSetControl(spc, ssu, history.NewFakeHistory(informerFactory.Apps().V1beta1().ControllerRevisions()), recorder) </ins> stop := make(chan struct{}) informerFactory.Start(stop)

informerFactory := informers.NewSharedInformerFactory(client, controller.NoResyncPeriodFunc()) spc := newFakeStatefulPodControl(informerFactory.Core().V1().Pods(), informerFactory.Apps().V1beta1().StatefulSets()) ssu := newFakeStatefulSetStatusUpdater(informerFactory.Apps().V1beta1().StatefulSets()) <del> ssc := defaultStatefulSetControl{spc, ssu, history.NewFakeHistory(informerFactory.Apps().V1beta1().ControllerRevisions())} </del> <ins> recorder := record.NewFakeRecorder(10) ssc := defaultStatefulSetControl{spc, ssu, history.NewFakeHistory(informerFactory.Apps().V1beta1().ControllerRevisions()), recorder} </ins> stop := make(chan struct{}) defer close(stop)

"k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/tools/cache" <ins> "k8s.io/client-go/tools/record" </ins> "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/history" )

ssh := history.NewFakeHistory(informerFactory.Apps().V1beta1().ControllerRevisions()) ssc.podListerSynced = alwaysReady ssc.setListerSynced = alwaysReady <del> ssc.control = NewDefaultStatefulSetControl(fpc, ssu, ssh) </del> <ins> recorder := record.NewFakeRecorder(10) ssc.control = NewDefaultStatefulSetControl(fpc, ssu, ssh, recorder) </ins> return ssc, fpc }