Skip to content

upstreamable: resourceMap: group unscheduled pods in node view#493

Merged
gambtho merged 1 commit intoAzure:headlamp-downstreamfrom
gambtho:thgamble/paulfeedback
Mar 25, 2026
Merged

upstreamable: resourceMap: group unscheduled pods in node view#493
gambtho merged 1 commit intoAzure:headlamp-downstreamfrom
gambtho:thgamble/paulfeedback

Conversation

@gambtho
Copy link
Copy Markdown
Collaborator

@gambtho gambtho commented Mar 20, 2026

Summary

Pods without a spec.nodeName (e.g. pending due to quota or scheduling failures) were silently ungrouped in the Map tab's "Group by Node" view. This made it impossible to see or troubleshoot unscheduled pods from the Map.

  • Return an "Unscheduled" sentinel instead of undefined for pods without nodeName, so they appear in a visible group
  • Skip K8s Node object linking for the Unscheduled group (no real node to link)
  • Updated existing test + added new test for the Unscheduled group

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

Fixes #492 (partially — Map tab fix only; quota warning is in #494)

Changes Made

File Change
graphGrouping.tsx Node grouping accessor returns 'Unscheduled' for pods without nodeName; guard added to skip Node object linking for the Unscheduled group
graphGrouping.test.ts Updated "groups nodes by node" expectations; added test verifying Unscheduled group has no linked kubeObject

Testing

  • Unit tests pass (npx vitest run graphGrouping)
  • 10/10 grouping tests pass including 2 updated/new tests

Test Cases

  1. Pods without nodeName are grouped into Node-Unscheduled (updated existing test)
  2. Unscheduled group has label 'Unscheduled', no linked kubeObject, and correct member count (new test)
  3. Pods with nodeName continue to group correctly under their node (existing, unchanged)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@gambtho gambtho force-pushed the thgamble/paulfeedback branch from 14a37f2 to 3212591 Compare March 20, 2026 15:02
@gambtho gambtho marked this pull request as ready for review March 20, 2026 15:02
Copilot AI review requested due to automatic review settings March 20, 2026 15:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Map tab “Group by Node” view so Pods without spec.nodeName appear as a visible “Unscheduled” group, and avoids linking that group to a nonexistent K8s Node object.

Changes:

  • Node grouping accessor returns an "Unscheduled" sentinel for Pods missing spec.nodeName
  • Prevents K8s Node object linking for the Unscheduled group
  • Updates/extends unit tests to cover the Unscheduled grouping behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
frontend/src/components/resourceMap/graph/graphGrouping.tsx Adds “Unscheduled” sentinel grouping and guards K8s Node linking for it
frontend/src/components/resourceMap/graph/graphGrouping.test.ts Updates expectations for node grouping and adds a test for Unscheduled group behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/resourceMap/graph/graphGrouping.test.ts Outdated
Comment thread frontend/src/components/resourceMap/graph/graphGrouping.test.ts Outdated
Comment thread frontend/src/components/resourceMap/graph/graphGrouping.test.ts
Comment thread frontend/src/components/resourceMap/graph/graphGrouping.test.ts Outdated
@gambtho gambtho force-pushed the thgamble/paulfeedback branch from 3212591 to 2992061 Compare March 20, 2026 15:35
@gambtho gambtho marked this pull request as draft March 20, 2026 15:37
@gambtho gambtho marked this pull request as ready for review March 20, 2026 21:44
Copilot AI review requested due to automatic review settings March 20, 2026 21:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/resourceMap/graph/graphGrouping.test.ts
@gambtho gambtho merged commit 6214251 into Azure:headlamp-downstream Mar 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants