Skip to content

fix(kubernetes): fetch Helm release resources at their real API paths - #5881

Merged
norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:fix/helm-resource-urls
Sep 3, 2026
Merged

fix(kubernetes): fetch Helm release resources at their real API paths#5881
norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:fix/helm-resource-urls

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Follow-on from #5880. While that graph was being verified, the backend log
filled with a passthrough 404 every ten seconds for four resources of the
traefik release, and the affected nodes opened an empty preview panel.

getRestURL in the release poller built each URL by hand and got three
things wrong:

  • Cluster-scoped kinds were fetched under the release namespace. Helm stamps
    the release namespace onto every manifest resource, and the code took a
    non-empty namespace to mean "namespaced". ClusterRole, ClusterRoleBinding
    and IngressClass all went to /namespaces/kube-system/....
  • The plural was the lowercased kind plus s, with a single y to ies
    rule. IngressClass became ingressclasss; Ingress would be ingresss.
  • /status was appended to every non-core kind unless it was on a short
    deny list. Custom resources such as Traefik's IngressRoute have no status
    subresource and 404.

A 404 removes the resource from the release on every poll, which is why the
preview stayed empty and the status never moved.

The fix takes each kind's plural and scope from the REST mapper that Helm's
action.Configuration already carries. It is discovery-backed, cached, and
covers CRDs. The poller fetches the resource itself, since a plain GET
returns its status, so the /status suffix and its deny list are gone.
The name-based guess stays as the fallback when discovery cannot map a kind,
now without /status and with es plurals for s, x, ch and sh
endings. NewHelmRelease takes the mapper in place of a PortalProxy
parameter it never used.

TestRestURL covers namespaced and cluster-scoped kinds through a default
mapper, the discovery-supplied plural, the unknown-kind fallback, the
no-mapper fallback pluraliser, and isClusterScoped.

Verified on the k3d test cluster's traefik release: zero passthrough 404s
across the poll window, and ClusterRole, ClusterRoleBinding, IngressClass
and IngressRoute all open a populated preview. make check gate green.

The release status poller built each resource URL by hand and got three
things wrong. Cluster-scoped kinds (ClusterRole, ClusterRoleBinding,
IngressClass) were fetched under the release namespace. The plural was
the kind plus "s", so IngressClass became "ingressclasss". And "/status"
was appended to every non-core kind, which custom resources such as a
Traefik IngressRoute do not have. Each of those answered 404 on every
ten-second poll, and a 404 removes the resource from the release, so the
preview panel for those nodes opened empty.

Resolve plural and scope through the REST mapper Helm's configuration
already provides, which is discovery-backed and covers CRDs, and fetch the
resource itself since a plain GET carries its status. The name-based
guess remains as the fallback when discovery cannot map a kind, now
without "/status" and with "es" plurals for s/x/ch/sh endings.

Verified on a k3d cluster's traefik release: zero passthrough 404s over
the poll window and populated previews for all four previously empty
nodes.
@norman-abramovitz
norman-abramovitz merged commit 2802a35 into cloudfoundry:develop Sep 3, 2026
24 checks passed
@nabramovitz
nabramovitz deleted the fix/helm-resource-urls branch September 3, 2026 16:53
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