Skip to content
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

with filesystem backend, please don't create the directory if non-existent #91

Open
calestyo opened this issue Nov 24, 2023 · 1 comment

Comments

@calestyo
Copy link

Hey.

When one has a bucked config like:

type: FILESYSTEM
config:
  directory: /path/to/dir
prefix: ''

Thanos, as of now, apparently creates an of these directories if they're non-existent.

It would be nice if it could just not do this (but only create directories below directory: as needed).

The reason is that one might e.g. use something like /mounpoint/dir and dir only existing when some other filesystem is actually mounted on /mounpoint and if not, Thanos should rather fail to write (and e.g. not fill up the system’s root fs).

If it however creates any missing directories, it would simply create /mounpoint/dir on the unmounted mountpoint directory.

Thanks,
Chris.

@calestyo
Copy link
Author

btw: It would of course be possible to have the unmounted /mounpoint/dir simply owned by the root user, while e.g. Thanos runs as thanos, wile the mounted /mounpoint/dir would be owned by thanos (which is also the workaround I do now).

But the problem with that is in specific, that I cannot use it with SSHFS and it's setuid= option (which determines the user as which the SSHFS mount is done), because this requires the mountpoint to be owned by the very same user (which would then need to be thanos as well).

Also, IMO it's generally rather unclean to generate a whole directory try which is conceptually outside the own "working directory" (i.e. what’s specified by directory:).

E.g. other daemons like postgresql wouldn't do that. They typically only create files beneath their own directories.

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

1 participant