From 3e826c4e80cc0cc4608615ea99ed45b2a26269ca Mon Sep 17 00:00:00 2001 From: wang yan Date: Tue, 22 Oct 2019 18:30:03 +0800 Subject: [PATCH] update query in the immutable delete manifest middleware Signed-off-by: wang yan --- src/core/middlewares/interceptor/immutable/deletemf.go | 2 ++ tests/apitests/python/test_project_quota.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/middlewares/interceptor/immutable/deletemf.go b/src/core/middlewares/interceptor/immutable/deletemf.go index b1b8e2495..6fb2e659a 100644 --- a/src/core/middlewares/interceptor/immutable/deletemf.go +++ b/src/core/middlewares/interceptor/immutable/deletemf.go @@ -29,6 +29,8 @@ func (dmf *delmfInterceptor) HandleRequest(req *http.Request) (err error) { artifactQuery := &models.ArtifactQuery{ Digest: dmf.mf.Digest, + Repo: dmf.mf.Repository, + PID: dmf.mf.ProjectID, } var afs []*models.Artifact afs, err = dao.ListArtifacts(artifactQuery) diff --git a/tests/apitests/python/test_project_quota.py b/tests/apitests/python/test_project_quota.py index 8ab8c842b..820568411 100644 --- a/tests/apitests/python/test_project_quota.py +++ b/tests/apitests/python/test_project_quota.py @@ -73,7 +73,7 @@ class TestProjects(unittest.TestCase): #5. Get project quota quota = self.system.get_project_quota("project", TestProjects.project_test_quota_id, **ADMIN_CLIENT) self.assertEqual(quota[0].used["count"], 1) - self.assertEqual(quota[0].used["storage"], 2791709) + self.assertEqual(quota[0].used["storage"], 2789174) #6. Delete repository(RA) by user(UA); self.repo.delete_repoitory(TestProjects.repo_name, **ADMIN_CLIENT)