diff --git a/pkg/models/controllers/pods.go b/pkg/models/controllers/pods.go index 709610c8c..c4341d8df 100644 --- a/pkg/models/controllers/pods.go +++ b/pkg/models/controllers/pods.go @@ -31,7 +31,7 @@ import ( "kubesphere.io/kubesphere/pkg/models/metrics" ) -const inUse = "in_use_pods" +const inUse = "kubesphere.io/in_use_pods" func (ctl *PodCtl) addAnnotationToPvc(item v1.Pod) { volumes := item.Spec.Volumes diff --git a/pkg/models/controllers/types.go b/pkg/models/controllers/types.go index 4c924ad25..9ddce4762 100644 --- a/pkg/models/controllers/types.go +++ b/pkg/models/controllers/types.go @@ -33,6 +33,7 @@ import ( const ( resyncCircle = 180 Stopped = "stopped" + PvcPending = "Pending" Running = "running" Updating = "updating" tablePods = "pods" diff --git a/pkg/models/resources.go b/pkg/models/resources.go index 1d80a69b6..1080b52d7 100644 --- a/pkg/models/resources.go +++ b/pkg/models/resources.go @@ -140,15 +140,18 @@ type workLoadStatus struct { } func GetNamespacesResourceStatus(namespace string) (*workLoadStatus, error) { - res := workLoadStatus{Count: make(map[string]int), NameSpace: namespace, Items: make(map[string]interface{})} var status *ResourceList var err error - for _, resource := range []string{controllers.Deployments, controllers.Statefulsets, controllers.Daemonsets} { + for _, resource := range []string{controllers.Deployments, controllers.Statefulsets, controllers.Daemonsets, controllers.PersistentVolumeClaim} { + resourceStatus := controllers.Updating + if resource == controllers.PersistentVolumeClaim { + resourceStatus = controllers.PvcPending + } if len(namespace) > 0 { - status, err = ListResource(resource, fmt.Sprintf("status=%s,namespace=%s", controllers.Updating, namespace), "") + status, err = ListResource(resource, fmt.Sprintf("status=%s,namespace=%s", resourceStatus, namespace), "") } else { - status, err = ListResource(resource, fmt.Sprintf("status=%s", controllers.Updating), "") + status, err = ListResource(resource, fmt.Sprintf("status=%s", resourceStatus), "") } if err != nil {