Skip to content

[BUG] k8s-status: Completed Job/CronJob pods flagged as problems (READY 0/1 check) #596

Description

@ersintarhan

Plugin

davemhammer/k8s-status

Submission checklist

  • I have searched existing issues and confirmed this is not a duplicate.
  • I am using the latest available version of Noctalia and of the plugin.
  • This is a bug in a community plugin, not in Noctalia itself (those belong in the noctalia repo).

Bug

Completed Job / CronJob pods are shown as problems in the widget, panel and /kube problems launcher.

Root cause

In k8s-status/plugin/service.luau, isProblemPhase() correctly whitelists Running/Succeeded/Completed. However the pod problem check combines it with a readiness ratio:

local problem = isProblemPhase(status) or (want > 0 and have < want) or restartsNum > 5

Completed Job pods report READY 0/1 (their containers have exited), so want > 0 and have < want is true and the pod is flagged as a problem despite STATUS=Completed.

Expected behavior

Finished pods (Completed/Succeeded) should not be counted as problems.

Suggested fix

Skip the readiness-ratio check for finished phases:

local finished = status == "Succeeded" or status == "Completed"
local problem = isProblemPhase(status)
  or (not finished and want > 0 and have < want)
  or restartsNum > 5

Happy to send a PR if you agree with the approach.

Environment

  • Plugin version: current main
  • Cluster: k3s / Talos-based (happens with any CronJob/Jobs that leave completed pods)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions