Skip to content

Is it possible to allow write access to a mounted directory? #3018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
k0pernicus opened this issue Feb 21, 2025 · 5 comments
Closed

Is it possible to allow write access to a mounted directory? #3018

k0pernicus opened this issue Feb 21, 2025 · 5 comments

Comments

@k0pernicus
Copy link

Hi,

In my spin app I allowed access to a full local directory, like this, mentioned in the file server example:

[component.my_file_storage]
...
files = [{ source="storage_directory", destination="/" }]

Reading files from this directory is fine: it finds the files, I can open them and stream the content.
However I wanted to create some files or directories from the spin app to my local directory, which is not possible at this stage (leads to an "Operation not permitted" os error).

It seems that files is read-only, as stated in this issue: #605.
But is it possible to change the permissions to read & write?

It seems allow_transient_writes is not allowed anymore, and I did not find anything relevant in the documentation unfortunately.

Thanks in advance

@kate-goldenring
Copy link
Contributor

Hi @k0pernicus. I looks like the flag was removed in this PR under the premise that Spin already allows writing new files: #763 (comment). However, I was able to produce your issue. I would have expected using --direct-mounts to resolve the issue; however it doesn't.

@lann
Copy link
Collaborator

lann commented Feb 21, 2025

The flag is still available: --allow-transient-write. Note that this functionality is not available in other runtimes so depending it will make your app less portable.

@kate-goldenring
Copy link
Contributor

@k0pernicus, note you will need to specify both flags: spin up --allow-transient-write --direct-mounts

@k0pernicus
Copy link
Author

Hi @lann and @kate-goldenring, this is exactly what I was looking for :)

Thanks a lot for your help!

@kate-goldenring
Copy link
Contributor

@k0pernicus this fix will enable you to stop using direct mounts. Thank you for helping us identify this bug #3020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants