Skip to content

Deployment “Replicas” row never shown #5921

@Jay2006sawant

Description

@Jay2006sawant

Describe the bug

On the Deployment details page, the Replicas row in extra info is hidden even when Kubernetes has populated status.replicas, status.readyReplicas, etc.

showReplicas() checks item.spec?.status?.replicas, but Deployments do not have spec.status — replica counts live on status, not spec. This looks like a typo (spec.status vs status).

Expected: When a Deployment has replica counts in status, the Replicas row should appear (as renderReplicas() already reads from item.status).

Actual: The row stays hidden whenever spec.replicas is unset, even if status has replica data.

Evidence in code:

  function showReplicas(item: Workload) {
    return (
      item.kind === 'Deployment' &&
      (item.spec?.status?.replicas !== undefined || item.spec?.replicas !== undefined)
    );
  }

To Reproduce

  1. Open Headlamp and connect to a cluster.
  2. Find or create a Deployment where status.replicas / status.readyReplicas exist but spec.replicas is not present in the API response (or use a Deployment right after creation before spec is fully reflected).
  3. Open the Deployment details page.
  4. Observe that the Replicas row is missing under extra info, even though replica status exists in the object.

Environment (please provide info about your environment):

  • Installation type: From source (npm start)
  • Headlamp Version: main branch (app 0.42.0 in /app/package.json)
  • Other: Reproducible in browser UI; logic bug in frontend/src/components/workload/Details.tsx

Are you able to fix this issue?

Yes (I will propose a PR)

Additional Context

  • renderReplicas() (lines 153–158) already reads from item.status.* correctly — only the visibility guard is wrong.
  • No existing GitHub issue found for spec.status.replicas / Deployment replicas row.
  • Likely a long-standing typo, not a recent regression.

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/needs-informationIndicates an issue needs more information in order to work on it.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions