diff --git a/Chart.yaml b/Chart.yaml index 59969a6..b985eec 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,5 +1,5 @@ name: cluster-map -version: 0.8.2 +version: 0.8.3 dependencies: - name: deckhouse_lib_helm version: 1.72.24 diff --git a/changelog.yaml b/changelog.yaml index e2afa47..fb70bc5 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,3 +1,6 @@ +v0.8.3: + fixes: + - UnexpectedJob warnings (the CronJob controller's note on every manual run) are listed for information and no longer badge the CronJob. v0.8.2: fixes: - An Ingress that answers with a redirect (redirect annotations, or rewrite ... permanent / return 30x in a snippet) is not reported for a backend Service that does not exist; Deckhouse's prometheus Ingress does exactly that. diff --git a/images/cluster-map/src/internal/topology/problems.go b/images/cluster-map/src/internal/topology/problems.go index 2564764..1eb3ebb 100644 --- a/images/cluster-map/src/internal/topology/problems.go +++ b/images/cluster-map/src/internal/topology/problems.go @@ -67,7 +67,11 @@ var ( "FailedCreatePodSandBox": true, "BackOff": true, "Evicted": true, "OOMKilling": true, "FailedKillPod": true, "ProvisioningFailed": true, "FailedBinding": true, "NetworkNotReady": true, "SystemOOM": true, } - eventRepeats = 5 + eventRepeats = 5 + // Warnings Kubernetes emits for normal operation. UnexpectedJob comes + // from the CronJob controller for every Job of the CronJob it did not + // schedule itself, i.e. every manual run (kubectl create job --from). + eventBenign = map[string]bool{"UnexpectedJob": true} waitingCritical = map[string]bool{ "CrashLoopBackOff": true, "ImagePullBackOff": true, "ErrImagePull": true, "InvalidImageName": true, "CreateContainerConfigError": true, "CreateContainerError": true, "RunContainerError": true, @@ -389,7 +393,7 @@ func eventProblems(s *problemSet, events []corev1.Event, podOwner map[string]str } for _, k := range order { p := folded[k] - if !eventNotable[p.Reason] && p.Count < eventRepeats { + if eventBenign[p.Reason] || (!eventNotable[p.Reason] && p.Count < eventRepeats) { p.Severity = Info } // the pod the latest event was about is gone: history, not state diff --git a/images/cluster-map/src/internal/topology/problems_test.go b/images/cluster-map/src/internal/topology/problems_test.go index 299ede2..bf9fd4a 100644 --- a/images/cluster-map/src/internal/topology/problems_test.go +++ b/images/cluster-map/src/internal/topology/problems_test.go @@ -182,8 +182,12 @@ func TestRedirectIngressAndGonePods(t *testing.T) { events: []corev1.Event{ {Type: corev1.EventTypeWarning, Reason: "FailedMount", LastTimestamp: metav1.NewTime(t0), InvolvedObject: corev1.ObjectReference{Kind: "Pod", Namespace: "shop", Name: "web-5f-live"}}, {Type: corev1.EventTypeWarning, Reason: "Failed", Count: 10, LastTimestamp: metav1.NewTime(t0), InvolvedObject: corev1.ObjectReference{Kind: "Pod", Namespace: "shop", Name: "verify-gone"}}, + {Type: corev1.EventTypeWarning, Reason: "UnexpectedJob", Count: 6, LastTimestamp: metav1.NewTime(t0), InvolvedObject: corev1.ObjectReference{Kind: "CronJob", Namespace: "shop", Name: "backup"}}, }, }) + if p := problemsOf(g, "ns/shop")["UnexpectedJob"]; p.Severity != Info { + t.Errorf("a manual CronJob run is not a problem: %+v", p) + } if len(problemsOf(g, "ingress/d8-monitoring/grafana-v10")) != 0 { t.Error("a redirecting Ingress reported for its unused backend") }