Skip to content

[Bug]: HealthDashboard marks completed Succeeded batch pods as failed with red ✖ and 'UnknownError' #262

Description

@utkarsh232005

Bug Description

In src/ui/HealthDashboard.tsx, the determination of whether a pod is failing is implemented as:

const isFailing = item.type === 'pod'
  ? (item.status !== 'Running' && item.status !== 'Pending')
  : (item.status !== 'running');

In Kubernetes, successfully completed batch Jobs, CronJobs, and completion tasks have status item.status === 'Succeeded'.
Because 'Succeeded' is neither 'Running' nor 'Pending', isFailing evaluates to true for every completed Job.

Consequently:

  1. The health dashboard displays a failure icon (✖) in red for all completed jobs.
  2. In getPodInspection, completed pods hit the fallback:
    return {
      reason: 'UnknownError',
      events: 'No events available',
      action: 'Check logs or restart the service'
    };
    Instructing the user to check logs or restart a successfully finished task.

Steps to Reproduce

  1. In a Kubernetes cluster with completed Jobs (e.g. backup CronJob), run:
    kdm health pods
  2. Locate the finished Job pod.
  3. Observe red ✖ icon and UnknownError diagnostic details.

Expected Behavior

  • Pods with phase 'Succeeded' should be considered healthy / completed (green ✔ or blue status indicator).
  • They should not be inspected with UnknownError.

Actual Behavior

Healthy completed jobs are flagged as critical failures.

Environment

  • OS: All
  • CLI version: v2.0.1
  • Affected component: src/ui/HealthDashboard.tsx

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions