Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion portal-ui/src/screens/Console/Storage/StoragePVCs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const StorageVolumes = ({
.invoke("GET", `/api/v1/list-pvcs`)
.then((res: IPVCsResponse) => {
let volumes = get(res, "pvcs", []);
setRecords(volumes);
setRecords(volumes ? volumes : []);
setLoading(false);
})
.catch((err) => {
Expand Down
17 changes: 10 additions & 7 deletions restapi/admin_tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1391,14 +1391,17 @@ func getTenantPodsResponse(session *models.Principal, params admin_api.GetTenant
return nil, prepareError(err)
}
retval := []*models.TenantPod{}
for i := range pods.Items {
restarts := int64(pods.Items[i].Status.ContainerStatuses[0].RestartCount)
retval = append(retval, &models.TenantPod{Name: &pods.Items[i].ObjectMeta.Name,
Status: string(pods.Items[i].Status.Phase),
TimeCreated: pods.Items[i].CreationTimestamp.Unix(),
PodIP: pods.Items[i].Status.PodIP,
for _, pod := range pods.Items {
var restarts int64 = 0
if len(pod.Status.ContainerStatuses) > 0 {
restarts = int64(pod.Status.ContainerStatuses[0].RestartCount)
}
retval = append(retval, &models.TenantPod{Name: &pod.ObjectMeta.Name,
Status: string(pod.Status.Phase),
TimeCreated: pod.CreationTimestamp.Unix(),
PodIP: pod.Status.PodIP,
Restarts: restarts,
Node: pods.Items[i].Spec.NodeName})
Node: pod.Spec.NodeName})
}
return retval, nil
}
Expand Down
7 changes: 6 additions & 1 deletion restapi/admin_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package restapi
import (
"context"

miniov1 "github.com/minio/operator/pkg/apis/minio.min.io/v1"

"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/cluster"
"github.com/minio/console/models"
Expand Down Expand Up @@ -47,7 +49,10 @@ func getPVCsResponse(session *models.Principal) (*models.ListPVCsResponse, *mode
return nil, prepareError(err)
}

listOpts := metav1.ListOptions{}
// Filter Tenant PVCs. They keep their v1 tenant annotation
listOpts := metav1.ListOptions{
LabelSelector: miniov1.TenantLabel,
}

// List all PVCs
listAllPvcs, err2 := clientset.CoreV1().PersistentVolumeClaims("").List(ctx, listOpts)
Expand Down