fix: return when failed to manage pvc
This commit is contained in:
@@ -22,6 +22,7 @@ func (h *Handler) createPvc(c *gin.Context) {
|
||||
err := k8s.CreatePvc(req, h.clientset)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"success": false, "message": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusAccepted, gin.H{"success": true})
|
||||
}
|
||||
@@ -31,6 +32,7 @@ func (h *Handler) deletePvc(c *gin.Context) {
|
||||
err := k8s.DeletePvc(ID, h.clientset)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"success": false, "message": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusAccepted, gin.H{"success": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user