1. add an extended API of listing all pods mounting the specific PVC. 2. remove redundant logs

This commit is contained in:
wnxn
2018-05-25 17:45:34 +08:00
parent 09d7ccaaba
commit 06e7463ba0
4 changed files with 76 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import (
"kubesphere.io/kubesphere/pkg/apis/v1alpha/nodes"
"kubesphere.io/kubesphere/pkg/apis/v1alpha/registries"
"kubesphere.io/kubesphere/pkg/apis/v1alpha/storage"
"kubesphere.io/kubesphere/pkg/apis/v1alpha/volumes"
)
func init() {
@@ -35,6 +36,7 @@ func init() {
kubectl.Register(ws, "/namespaces/{namespace}/kubectl")
registries.Register(ws, "/registries")
storage.Register(ws, "/storage")
volumes.Register(ws, "/volumes")
// add webservice to default container
restful.Add(ws)

View File

@@ -0,0 +1,14 @@
package volumes
import (
"github.com/emicklei/go-restful"
"kubesphere.io/kubesphere/pkg/filter/route"
"kubesphere.io/kubesphere/pkg/models"
)
func Register(ws *restful.WebService, subPath string) {
ws.Route(ws.GET(subPath+"/namespaces/{namespace}/persistentvolumeclaims/{pvc}/pods").
To(models.GetPodListByPvc).Filter(route.RouteLogging)).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
}