Skip to content

Fix: Map diagram showing resources from other namespaces#704

Merged
gambtho merged 1 commit into
Azure:headlamp-downstreamfrom
tejhan:fix/map-cross-namespace-relations
Jun 2, 2026
Merged

Fix: Map diagram showing resources from other namespaces#704
gambtho merged 1 commit into
Azure:headlamp-downstreamfrom
tejhan:fix/map-cross-namespace-relations

Conversation

@tejhan
Copy link
Copy Markdown
Collaborator

@tejhan tejhan commented Jun 1, 2026

Description

This PR adds a namespace guard to makeRelation so that for namespace-scoped resources, edges are only drawn if they're in the same namespace. Previously we only matched by name/label, causing resources with identical names in different namespaces to be merged and shown under one namespace component in the view.

Resolves issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Closes #621

Changes Made

  • Added namespace equality check in makeRelation to prevent cross-namespace edges being drawn for identically named resources.

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

Test Cases

Describe the test cases that were run:

  1. Create 2 deployments/resources with identical names.
  2. Open the Map view & observe that the deployments for one namespace don't appear in another.

@tejhan tejhan self-assigned this Jun 1, 2026
Copilot AI review requested due to automatic review settings June 1, 2026 17:51
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

This PR fixes the Resource Map’s relation-building logic to avoid drawing edges between namespace-scoped resources that happen to share the same name/labels across different namespaces, which previously caused cross-namespace resources to appear/merge when filtering by namespace.

Changes:

  • Added a namespace equality guard inside makeRelation so relations only connect namespaced objects within the same namespace.

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

Signed-off-by: tejhan-diallo <tejhan.diallo@gmail.com>
@tejhan tejhan force-pushed the fix/map-cross-namespace-relations branch from 4f981ce to 2c1301e Compare June 1, 2026 18:34
@tejhan tejhan requested a review from Copilot June 1, 2026 18:57
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 1 out of 1 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Collaborator

@gambtho gambtho left a comment

Choose a reason for hiding this comment

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

lgtm

@gambtho gambtho merged commit d03770f into Azure:headlamp-downstream Jun 2, 2026
11 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