1. add an extended API of listing all pods mounting the specific PVC. 2. remove redundant logs
This commit is contained in:
@@ -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)
|
||||
|
||||
14
pkg/apis/v1alpha/volumes/volumes_handler.go
Normal file
14
pkg/apis/v1alpha/volumes/volumes_handler.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user