argocd: Add Application Resource Tree Map - #1176
Open
Joshna907 wants to merge 4 commits into
Open
Conversation
Joshna907
requested review from
ashu8912,
illume,
joaquimrocha,
skoeva,
sniok,
vyncent-t and
yolossn
as code owners
August 14, 2026 12:53
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Joshna907
force-pushed
the
codex/argocd-application-resource-tree
branch
from
August 14, 2026 12:59
d18abd9 to
3dec49d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Argo CD Application topology to Headlamp’s Map, including optional AppProject hierarchy and safe synthetic nodes.
Changes:
- Builds Application, managed-resource, ownership, and AppProject graphs.
- Registers Map sources and Argo resource icons.
- Adds graph status mapping and unit coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
argocd/src/mapView.tsx |
Defines Argo CD Map sources. |
argocd/src/mapView.test.tsx |
Tests source loading and configuration. |
argocd/src/index.tsx |
Registers Map source and kind icons. |
argocd/src/index.test.tsx |
Tests new registrations. |
argocd/src/components/applications/statusHelpers.ts |
Maps Argo statuses to graph statuses. |
argocd/src/components/applications/statusHelpers.test.ts |
Tests graph status mapping. |
argocd/src/components/applications/resourceTree.ts |
Constructs Application and AppProject graphs. |
argocd/src/components/applications/resourceTree.test.ts |
Tests graph construction and safety behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Joshna907
force-pushed
the
codex/argocd-application-resource-tree
branch
from
August 15, 2026 11:06
b6644b4 to
85dbab7
Compare
Contributor
Author
|
ptal @illume |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (3)
argocd/src/mapView.tsx:63
- Because this source is enabled by default, this unfiltered
Pod.useList()performs a cluster-wide Pod list/watch whenever the Map is opened, even when displayed Applications reference no Pods. On large clusters this can dominate network, memory, and graph-loading cost; resolve only GVK/namespace/name descriptors reported by the Applications (leaving failures synthetic), or make this high-cardinality live resolution opt-in.
const [pods, podError] = Pod.useList();
argocd/src/components/applications/resourceTree.ts:239
- This same-namespace requirement drops valid Argo CD “Applications in any namespace” relationships. In that mode, the Application lives in an allowed source namespace while its referenced AppProject remains in the Argo CD control-plane namespace, so the hierarchy will leave those Applications as roots (including references to the default project). Match projects using Argo CD’s project/source-namespace rules rather than requiring equal Kubernetes namespaces.
const projectApplications = applications.filter(
application =>
application.metadata.namespace === project.metadata.namespace &&
(application.spec.project || 'default') === project.metadata.name
);
argocd/src/index.tsx:199
- This kind-only fallback is global, so any non-Argo CRD whose kind is also
Applicationwill receive the Argo CD icon. The Argo graph node already suppliesicon: argoIcon, and the preceding group-qualified registration covers normal Argo objects; remove this fallback rather than misidentifying unrelated Application resources.
registerKindIcon('Application', { icon: argoIcon, color: ARGO_ICON_COLOR });
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an Argo CD Application resource-tree integration to Headlamp's standard Map page. Applications appear as topology roots connected to the Kubernetes resources reported in
Application.status.resources. An optional AppProject hierarchy source addsAppProject -> Application -> managed resourceswithout changing the default Applications-only view.The implementation preserves Headlamp's native resource experience for verified local objects and treats remote, unsupported, or unresolved objects as safe read-only nodes.
Why the standard Map page?
The Application detail page already provides GitOps Summary, Managed Resources, Sync Policy, Sync History, and Conditions. Topology and relationships belong in Headlamp's existing Map instead of adding a duplicate resource-tree section to the Application detail page.
Why strict local and remote handling?
Argo CD managed-resource references do not contain live Kubernetes UIDs or owner references. The selected Headlamp cluster is therefore used only when an Application explicitly targets
https://kubernetes.default.svcor thein-clusterdestination. Every other destination is treated as remote or unverified so a same-named object in the wrong cluster is never opened.Changes
Added
src/components/applications/resourceTree.ts— Pure graph construction helpers for resource identity, local/remote safety, live-object matching, synthetic nodes, deduplication, Argo CD management edges, AppProject hierarchy edges, and UID-only Kubernetes owner edges.src/components/applications/resourceTree.test.ts— Unit coverage for local and remote resolution, descriptor matching, synthetic nodes, ownership, shared resources, project isolation, deduplication, and compact graph content.src/components/applications/statusHelpers.test.ts— Graph-status priority and partial-status tests.src/mapView.tsx— Public Headlamp Map sources for Applications and the optional AppProject hierarchy overlay, using fixed supported resource classes.src/mapView.test.tsx— Source loading, missing-CRD, hierarchy-status, and empty-graph tests.Changed
src/components/applications/statusHelpers.ts— Added graph-specificsuccess,warning, anderrorstatus mapping.src/index.tsx— Registers both Map sources and offline Argo icons for Application and AppProject nodes.src/index.test.tsx— Verifies the Map sources are registered exactly once and keeps the existing route, sidebar, CRD-guard, AppProject, and Namespace GitOps Insights assertions.Map behavior
Application -> managed resourcerelationships.containsedges while reusing Application nodes from the Applications source.kubeObjector native detail link.ownerReferencesUID matches another resolved local node.contains,manages, andowns.Supported resource resolution
The source uses fixed
useList()calls for standard Headlamp resource classes: Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob, Pod, Service, ConfigMap, Secret, PersistentVolumeClaim, Ingress, NetworkPolicy, and HorizontalPodAutoscaler. Certificate and Rollout are resolved only when their optional CRDs are available. Other managed resources remain safe synthetic nodes.Validation
Screenshots
Steps to Test
AppProject -> Application -> resources.ownsedges appear. Matching names or labels alone must not create ownership edges.