From 9d7bc3e6a0ca7b1fbceb2983086897aad460722b Mon Sep 17 00:00:00 2001 From: Idan Novogroder <43949240+idanovo@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:03:38 +0200 Subject: [PATCH] Doc why we skip ensureStorageNamespace for read-only repositories (#8396) --- pkg/api/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 4e3e7a34ad5..7004db34abe 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -1987,7 +1987,8 @@ func (c *Controller) CreateRepository(w http.ResponseWriter, r *http.Request, bo writeResponse(w, r, http.StatusCreated, response) return } - + // Since this is a read-only repository, there is no harm in case the storage namespace we use is already used by + // another repository or if we don't have write permissions for this namespace. if !swag.BoolValue(body.ReadOnly) { if err := c.ensureStorageNamespace(ctx, body.StorageNamespace); err != nil { var (