openova/products/catalyst/bootstrap
e3mrah 09b35d0943
fix(k8scache): factory.List + tree.GetResourcesBySelector resolve plural alias (qa-loop iter-1) (#1193)
Followup to #1191. The handler-tier Registry.Get already accepts
plural / short-form aliases ("services", "pvc"), but the downstream
indexer lookups in Factory.List and Factory.GetResourcesBySelector
re-canonicalised the raw inbound `kindName` and so still keyed off
the plural form — the indexers map is populated with singular
canonical Names from AddCluster, so "services" missed and the call
returned `k8scache: kind "services" not registered`.

Live evidence post-#1191 deploy on omantel.biz: every cloud-list TC
still 404'd with the new error message ("not registered" instead of
"unknown kind"), proving the handler now resolves the alias but the
factory tier doesn't.

Fix: both lookups go through Registry.Get first to obtain the
canonical singular Name, then index into cs.indexers with that.
metricCacheSize label switches to the canonical form too so plural
and singular variants of the same query roll up to one prometheus
time-series instead of fanning out cardinality.

Tests:
  - TestFactory_ListResolvesPluralAlias — alias forms ("pods", "Pod",
    "PODS", "po") all return the same Pod the canonical "pod" call
    returns; "notakind" still errors.

Co-authored-by: hatiyildiz <hati.yildiz@openova.io>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:33:11 +04:00
..
api fix(k8scache): factory.List + tree.GetResourcesBySelector resolve plural alias (qa-loop iter-1) (#1193) 2026-05-09 15:33:11 +04:00
ui fix(ui): normalise resource detail kind URL plural→singular (qa-loop iter-1) (#1192) 2026-05-09 15:33:04 +04:00