mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
fix: use apiVersion to disambiguate CRDs with same kind (#504)
When multiple CRDs share the same kind but different API groups (e.g. Traefik's Middleware under traefik.io and traefik.containo.us), the dashboard failed to look up the correct resource. Thread apiVersion through the resource fetch chain and use group-qualified kind (e.g. Widget.new.example.com) for kubectl lookups. Closes #504 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,8 @@ func (h *KubeHandler) GetResourceInfo(c *gin.Context) {
|
||||
return // sets error inside
|
||||
}
|
||||
|
||||
res, err := app.K8s.GetResourceInfo(c.Param("kind"), qp.Namespace, qp.Name)
|
||||
kind := utils.QualifiedKind(c.Param("kind"), qp.APIVersion)
|
||||
res, err := app.K8s.GetResourceInfo(kind, qp.Namespace, qp.Name)
|
||||
if errors.IsNotFound(err) {
|
||||
res = &v12.Carp{Status: v12.CarpStatus{Phase: "NotFound", Message: err.Error()}}
|
||||
//_ = c.AbortWithError(http.StatusNotFound, err)
|
||||
@@ -160,7 +161,8 @@ func (h *KubeHandler) Describe(c *gin.Context) {
|
||||
return // sets error inside
|
||||
}
|
||||
|
||||
res, err := app.K8s.DescribeResource(c.Param("kind"), qp.Namespace, qp.Name)
|
||||
kind := utils.QualifiedKind(c.Param("kind"), qp.APIVersion)
|
||||
res, err := app.K8s.DescribeResource(kind, qp.Namespace, qp.Name)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user