treeverse / lakeFS

lakeFS - Data version control for your data lake | Git for data
https://docs.lakefs.io
Apache License 2.0
4.46k stars 359 forks source link

added storage namespace validation on non-readonly bare repo creation #8364

Open tkalir opened 1 week ago

tkalir commented 1 week ago

Closes #3165

Background

Currently bare repo creation doesn't check if namesapce storage is writable \ if a lakefs repo already exists there

Bug Fix

In Controller.go\CreateRepository, previously the code was -

  1. if bare repo, create and return
  2. if non-readonly repo, do namespace validation I only switched them places, so namespace validation happens also for non-readonly bare repos. nothing else is supposed to change. (but that does mean that bare repos create a dummy object at namespace root now, like other repos - see Controller.go\ensureStorageNamespace)

Testing Details

I added a system test to check that creating a bare repo in same namespace as existing repo returns an error. we can remove the test if it's unnecessary, but it will help to check the code.

Contact Details

tkalir@gmail.com \ Tamar Kalir on slack