local: avoid writing to content root on readonly store#10894
Merged
AkihiroSuda merged 1 commit intoOct 28, 2024
Conversation
A contentstore can be created on top of readonly path and should not fail unless there is an attempt to write into it. Currently this fails because new ingest directory is created always, meaning for example that you can't create a store to read blobs from OCI layout without it contaminating the OCI layout files. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
88bc402 to
3cc2343
Compare
tonistiigi
commented
Oct 25, 2024
| } | ||
|
|
||
| func (s *store) ensureIngestRoot() error { | ||
| return os.MkdirAll(filepath.Join(s.root, "ingest"), 0777) |
Member
Author
There was a problem hiding this comment.
This is different from ingest/ref that uses 0755. Not sure if bug.
Member
Author
There was a problem hiding this comment.
Just copying the old code. Commented as I think it should be 0755, but unrelated to this specific issue.
Member
There was a problem hiding this comment.
Looked up history, and it looks like these permissions come all the way from the initial implementation, and were just copied through during refactors 9008471
3 tasks
dmcgowan
approved these changes
Oct 28, 2024
AkihiroSuda
approved these changes
Oct 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A contentstore can be created on top of readonly path and should not fail unless there is an attempt to write into it.
Currently this fails because new ingest directory is created always, meaning for example that you can't create a store to read blobs from OCI layout without it contaminating the OCI layout files.