From 58c4ffe804ee700666637f4ef1e44a6c3d4c4bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=A7=D0=B5?= =?UTF-8?q?=D1=84=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 28 Sep 2026 16:46:05 +0300 Subject: [PATCH] v0.11.3: one FailedMount of a ready pod is information Co-Authored-By: Claude Opus 5.5 --- changelog.yaml | 3 +++ .../src/internal/topology/problems.go | 25 ++++++++++++++++--- .../src/internal/topology/problems_test.go | 10 ++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 0c8581f..d9e0b60 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,3 +1,6 @@ +v0.11.3: + fixes: + - "A single FailedMount of a pod that is running and ready (kubelet failing to refresh a volume, such as a ConfigMap prometheus-operator deletes and recreates) is listed for information; it badges the card after five repeats in the window, like other events." v0.11.2: fixes: - "Warning events of a pod that has since finished, and FailedScheduling of a pod that has since been scheduled, are listed for information and no longer badge the card: a backup CronJob that waited all night for its node and then ran stayed yellow for half an hour." diff --git a/images/cluster-map/src/internal/topology/problems.go b/images/cluster-map/src/internal/topology/problems.go index 75cf15c..3ef320a 100644 --- a/images/cluster-map/src/internal/topology/problems.go +++ b/images/cluster-map/src/internal/topology/problems.go @@ -178,7 +178,7 @@ func attachProblems(g *Graph, in problemInputs) { for _, n := range in.nodes { nodeProblems(s, n) } - eventProblems(s, in.events, podOwner, podsLive(in.pods), podsScheduled(in.pods)) + eventProblems(s, in.events, podOwner, podsLive(in.pods), podsScheduled(in.pods), podsReady(in.pods)) for _, n := range g.Nodes { if !syntheticProbe(n.Namespace, n.Label) { readinessProblem(s, n, notReadySince) @@ -396,7 +396,7 @@ func eventsInWindow(e corev1.Event, last time.Time) int { // eventProblems folds recent Warning events into one problem per card and // reason, keeping the latest message. -func eventProblems(s *problemSet, events []corev1.Event, podOwner map[string]string, live, scheduled map[string]bool) { +func eventProblems(s *problemSet, events []corev1.Event, podOwner map[string]string, live, scheduled, ready map[string]bool) { type key struct{ id, reason string } folded := map[key]*Problem{} var order []key @@ -420,11 +420,16 @@ func eventProblems(s *problemSet, events []corev1.Event, podOwner map[string]str } for _, k := range order { p := folded[k] - if eventBenign[p.Reason] || (!eventNotable[p.Reason] && p.Count < eventRepeats) { + pod := namespaceOfID(k.id) + "/" + p.Object + // A pod that is running and ready already has its volumes: a + // FailedMount then is kubelet failing to refresh one, e.g. a + // ConfigMap prometheus-operator deletes and recreates. Once is + // noise; it has to repeat like any other event. + notable := eventNotable[p.Reason] && (p.Reason != "FailedMount" || !ready[pod]) + if eventBenign[p.Reason] || (!notable && p.Count < eventRepeats) { p.Severity = Info } // the pod the latest event was about is gone: history, not state - pod := namespaceOfID(k.id) + "/" + p.Object if p.Object != "" && !live[pod] { p.Severity = Info } @@ -488,6 +493,18 @@ func podsLive(pods []corev1.Pod) map[string]bool { return out } +func podsReady(pods []corev1.Pod) map[string]bool { + out := make(map[string]bool, len(pods)) + for _, p := range pods { + for _, c := range p.Status.Conditions { + if c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue { + out[p.Namespace+"/"+p.Name] = true + } + } + } + return out +} + func podsScheduled(pods []corev1.Pod) map[string]bool { out := make(map[string]bool, len(pods)) for _, p := range pods { diff --git a/images/cluster-map/src/internal/topology/problems_test.go b/images/cluster-map/src/internal/topology/problems_test.go index 20302b4..d55448c 100644 --- a/images/cluster-map/src/internal/topology/problems_test.go +++ b/images/cluster-map/src/internal/topology/problems_test.go @@ -204,6 +204,16 @@ func TestRedirectIngressAndGonePods(t *testing.T) { if problemsOf(g, "wl/shop/deployment/web")["FailedMount"].Severity != Warning { t.Error("event of a live pod must badge") } + // the same pod once it is ready: a single FailedMount is a volume refresh + g2 := &Graph{Nodes: []Node{{ID: "ns/shop"}, {ID: "wl/shop/deployment/web"}}} + attachProblems(g2, problemInputs{ + pods: []corev1.Pod{{ObjectMeta: metav1.ObjectMeta{Name: "web-5f-live", Namespace: "shop", OwnerReferences: owned("ReplicaSet", "web-5f")}, + Status: corev1.PodStatus{Phase: corev1.PodRunning, Conditions: []corev1.PodCondition{{Type: corev1.PodReady, Status: corev1.ConditionTrue}}}}}, + events: []corev1.Event{{Type: corev1.EventTypeWarning, Reason: "FailedMount", LastTimestamp: metav1.NewTime(t0), InvolvedObject: corev1.ObjectReference{Kind: "Pod", Namespace: "shop", Name: "web-5f-live"}}}, + }) + if p := problemsOf(g2, "wl/shop/deployment/web")["FailedMount"]; p.Severity != Info { + t.Errorf("one FailedMount of a ready pod must be information: %+v", p) + } if p := problemsOf(g, "ns/shop")["Failed"]; p.Severity != Info { t.Errorf("event of a deleted pod must be information: %+v", p) }