From cfbeeff7bbaaed64675bab8450d90655ee8c09b9 Mon Sep 17 00:00:00 2001 From: peusebiu Date: Thu, 3 Oct 2024 21:26:22 +0300 Subject: [PATCH] fix(metrics): update storage metrics on gc (#2698) Signed-off-by: Eusebiu Petu --- pkg/storage/imagestore/imagestore.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/storage/imagestore/imagestore.go b/pkg/storage/imagestore/imagestore.go index 6970b70e..be7ed17a 100644 --- a/pkg/storage/imagestore/imagestore.go +++ b/pkg/storage/imagestore/imagestore.go @@ -1634,6 +1634,11 @@ func (is *ImageStore) CleanupRepo(repo string, blobs []godigest.Digest, removeRe } } + // finally update metrics + if is.storeDriver.Name() == storageConstants.LocalStorageDriverName { + monitoring.SetStorageUsage(is.metrics, is.rootDir, repo) + } + return count, nil }