This commit adds type information to events.

This addresses issue #15624.
This commit is contained in:
Avesh Agarwal
2015-11-13 17:30:01 -05:00
parent 751e7ba67c
commit 3d5207fd73
29 changed files with 166 additions and 120 deletions

View File

@@ -308,11 +308,11 @@ func (r RealPodControl) createPods(nodeName, namespace string, template *api.Pod
return fmt.Errorf("unable to create pods, no labels")
}
if newPod, err := r.KubeClient.Pods(namespace).Create(pod); err != nil {
r.Recorder.Eventf(object, "FailedCreate", "Error creating: %v", err)
r.Recorder.Eventf(object, api.EventTypeWarning, "FailedCreate", "Error creating: %v", err)
return fmt.Errorf("unable to create pods: %v", err)
} else {
glog.V(4).Infof("Controller %v created pod %v", meta.Name, newPod.Name)
r.Recorder.Eventf(object, "SuccessfulCreate", "Created pod: %v", newPod.Name)
r.Recorder.Eventf(object, api.EventTypeNormal, "SuccessfulCreate", "Created pod: %v", newPod.Name)
}
return nil
}