mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Fix the panic
This commit is contained in:
@@ -77,6 +77,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, false)
|
qp, err := getQueryProps(c, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
err = data.UninstallChart(qp.Namespace, qp.Name)
|
err = data.UninstallChart(qp.Namespace, qp.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -90,6 +91,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, true)
|
qp, err := getQueryProps(c, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = data.Revert(qp.Namespace, qp.Name, qp.Revision)
|
err = data.Revert(qp.Namespace, qp.Name, qp.Revision)
|
||||||
@@ -104,6 +106,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, false)
|
qp, err := getQueryProps(c, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := data.ChartHistory(qp.Namespace, qp.Name)
|
res, err := data.ChartHistory(qp.Namespace, qp.Name)
|
||||||
@@ -118,6 +121,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, true)
|
qp, err := getQueryProps(c, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := data.RevisionManifestsParsed(qp.Namespace, qp.Name, qp.Revision)
|
res, err := data.RevisionManifestsParsed(qp.Namespace, qp.Name, qp.Revision)
|
||||||
@@ -132,6 +136,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, true)
|
qp, err := getQueryProps(c, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
flag := c.Query("flag") == "true"
|
flag := c.Query("flag") == "true"
|
||||||
@@ -139,6 +144,7 @@ func configureHelms(api *gin.Engine, data *DataLayer) {
|
|||||||
res, err := handleGetSection(data, c.Param("section"), rDiff, qp, flag)
|
res, err := handleGetSection(data, c.Param("section"), rDiff, qp, flag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
c.String(http.StatusOK, res)
|
c.String(http.StatusOK, res)
|
||||||
})
|
})
|
||||||
@@ -195,6 +201,7 @@ func configureKubectls(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, false)
|
qp, err := getQueryProps(c, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := data.GetResource(qp.Namespace, &GenericResource{
|
res, err := data.GetResource(qp.Namespace, &GenericResource{
|
||||||
@@ -226,6 +233,7 @@ func configureKubectls(api *gin.Engine, data *DataLayer) {
|
|||||||
qp, err := getQueryProps(c, false)
|
qp, err := getQueryProps(c, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusBadRequest, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := data.DescribeResource(qp.Namespace, c.Param("kind"), qp.Name)
|
res, err := data.DescribeResource(qp.Namespace, c.Param("kind"), qp.Name)
|
||||||
|
|||||||
Reference in New Issue
Block a user