From 28655845e35816b65dc19271ca5af011e55e6ed7 Mon Sep 17 00:00:00 2001 From: Nir Ozery Date: Mon, 4 Nov 2024 16:17:15 -0500 Subject: [PATCH] Fix: EnsureStorageNamespace close reader --- pkg/api/controller.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 9eb95edde03..0e40b53bc90 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -2112,8 +2112,12 @@ func (c *Controller) ensureStorageNamespace(ctx context.Context, storageNamespac return err } - _, err := c.BlockAdapter.Get(ctx, obj) - return err + s, err := c.BlockAdapter.Get(ctx, obj) + if err != nil { + return err + } + _ = s.Close() + return nil } func (c *Controller) DeleteRepository(w http.ResponseWriter, r *http.Request, repository string, params apigen.DeleteRepositoryParams) {