Skip to content

argocd: Add managed-resource API availability insights - #1184

Open
Joshna907 wants to merge 3 commits into
headlamp-k8s:mainfrom
Joshna907:codex/argocd-api-availability
Open

argocd: Add managed-resource API availability insights#1184
Joshna907 wants to merge 3 commits into
headlamp-k8s:mainfrom
Joshna907:codex/argocd-api-availability

Conversation

@Joshna907

Copy link
Copy Markdown
Contributor

Summary

This PR adds dynamic Kubernetes API-availability insights to the Argo CD Application detail page. For each resource reported by Application.status.resources, Headlamp compares the reported API group, version, and kind with the APIs served by the selected local Kubernetes cluster.

Why

Argo CD can report an Application as Synced and Healthy even when its manifest uses an API version that is no longer served by the cluster. Showing the reported Resource API next to the selected cluster's API availability helps operators spot that kind of mismatch earlier.

Changes

  • Add a cached Kubernetes discovery client that prefers aggregated discovery and falls back to legacy discovery for older clusters.
  • Compare group, version, and kind exactly; ignore discovery subresources.
  • Add Resource API and Cluster API columns to Managed Resources.
  • Show Available, Version not served, API not found, Unknown, or Not checked — remote with concise tooltips.
  • Keep remote or unverified Application destinations safe: no discovery request and no native resource links to the selected local cluster.
  • Document the scope: API availability is not a controller-feature or traffic diagnosis.

Validation

  • Prettier formatting check passed.
  • ESLint passed with zero warnings.
  • TypeScript passed with no emit.
  • All 5 test files and 31 tests passed.
  • Production build passed.

Steps to test

  1. Open an in-cluster Argo CD Application with managed resources.
  2. In Managed Resources, verify Resource API shows the API reported by Argo CD and Cluster API becomes Available when the selected cluster serves it.
  3. Use an Application/resource with an older or unavailable API version to verify Version not served or API not found.
  4. Open an Application targeting a remote or unverified destination. Verify Cluster API says Not checked — remote and managed-resource names do not open local Kubernetes details.

Limitation

A matching API only means the Kubernetes API server serves that resource API. It does not prove a controller implements every field or feature, and it does not prove traffic is working.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Kubernetes API availability insights to Argo CD managed resources while avoiding discovery and local links for remote destinations.

Changes:

  • Adds cached, concurrent API discovery and availability evaluation.
  • Adds availability columns, statuses, warnings, and remote safeguards.
  • Adds tests and documentation for discovery behavior and scope.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
argocd/src/api/apiDiscovery.ts Implements Kubernetes API discovery and caching.
argocd/src/api/apiDiscovery.test.ts Tests discovery, caching, and concurrency.
argocd/src/components/applications/apiAvailability.ts Evaluates and loads managed-resource API availability.
argocd/src/components/applications/apiAvailability.test.ts Tests availability states and asynchronous updates.
argocd/src/components/applications/Detail.tsx Displays API availability in Managed Resources.
argocd/README.md Documents the feature and its limitations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread argocd/src/api/apiDiscovery.ts Outdated
Comment thread argocd/src/components/applications/apiAvailability.ts Outdated
Comment thread argocd/src/components/applications/apiAvailability.ts Outdated
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
@Joshna907
Joshna907 force-pushed the codex/argocd-api-availability branch from d7caf2b to bba49eb Compare August 15, 2026 11:18
@illume
illume requested a balanced review from Copilot August 15, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

argocd/src/components/applications/Detail.tsx:380

  • The tooltip contains the only served-version/error detail, but its <span> trigger is not keyboard-focusable, so keyboard-only users cannot open it. Make the trigger focusable so MUI can show the tooltip on focus.
      <span>

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.

2 participants