Add namespace dropdown (#67)

* add get namespace endpoint

* add namespace dropdown

* misc fix
This commit is contained in:
Duy Nguyen
2022-11-06 15:19:32 +02:00
committed by GitHub
parent ef31263797
commit 612352d69f
6 changed files with 61 additions and 11 deletions

View File

@@ -1,12 +1,13 @@
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/komodorio/helm-dashboard/pkg/dashboard/subproc"
"github.com/komodorio/helm-dashboard/pkg/dashboard/utils"
"k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v12 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
"net/http"
)
type KubeHandler struct {
@@ -69,3 +70,13 @@ func (h *KubeHandler) Describe(c *gin.Context) {
c.String(http.StatusOK, res)
}
func (h *KubeHandler) GetNameSpaces(c *gin.Context) {
res, err := h.Data.GetNameSpaces()
if err != nil {
_ = c.AbortWithError(http.StatusInternalServerError, err)
return
}
c.JSON(http.StatusOK, res)
}