mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #113216 from astraw99/ftr-add-backoff-container
Add container name in the `BackOff` event message
This commit is contained in:
commit
79014dd6da
@ -920,7 +920,8 @@ func (m *kubeGenericRuntimeManager) doBackOff(pod *v1.Pod, container *v1.Contain
|
||||
key := getStableKey(pod, container)
|
||||
if backOff.IsInBackOffSince(key, ts) {
|
||||
if containerRef, err := kubecontainer.GenerateContainerRef(pod, container); err == nil {
|
||||
m.recorder.Eventf(containerRef, v1.EventTypeWarning, events.BackOffStartContainer, "Back-off restarting failed container")
|
||||
m.recorder.Eventf(containerRef, v1.EventTypeWarning, events.BackOffStartContainer,
|
||||
fmt.Sprintf("Back-off restarting failed container %s in pod %s", container.Name, format.Pod(pod)))
|
||||
}
|
||||
err := fmt.Errorf("back-off %s restarting failed container=%s pod=%s", backOff.Get(key), container.Name, format.Pod(pod))
|
||||
klog.V(3).InfoS("Back-off restarting failed container", "err", err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user