Skip to content

Commit

Permalink
fix monitor object storage (#4362)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Nov 29, 2023
1 parent 3eb6823 commit e649c51
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/resources/controllers/monitor_controller.go
Expand Up @@ -26,7 +26,6 @@ import (
"sync"
"time"

userv1 "github.com/labring/sealos/controllers/user/api/v1"
"github.com/labring/sealos/controllers/user/controllers/helper/config"

"github.com/minio/minio-go/v7"
Expand Down Expand Up @@ -352,7 +351,7 @@ func (r *MonitorReconciler) getResourceUsage(namespace *corev1.Namespace) ([]*re
r.Logger.Error(err, "failed to get pod traffic used", "namespace", namespace)
}
}
if username := config.GetUserNameByNamespace(namespace.Name); r.ObjStorageClient != nil && namespace.Labels[userv1.UserLabelOwnerKey] == username {
if username := config.GetUserNameByNamespace(namespace.Name); r.ObjStorageClient != nil {
if err := r.getObjStorageUsed(username, &resNamed, &resUsed); err != nil {
r.Logger.Error(err, "failed to get object storage used", "username", username)
}
Expand Down

0 comments on commit e649c51

Please sign in to comment.