-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[FEATURE REQUEST] Add a skip_cache argument to file.managed to suppress caching #64373
Comments
ADDENDUM: This argument should/must be ignored if |
What if
What if, after it's overwritten the current file, it turns out the There are very complex problems here, if you're trying to take a security feature and use it for performance instead.
The only part of this that I think is a good idea, is checking whether the current file already matches |
Just seeing this now, sorry.
Dunno, did you mean
Presumably it'd be a
I am trying to not make Salt store a file twice whatsoever (and am trying to avoid huge many-hundreds-of-gebibytes files being written to the cache whatsoever).
Nope. It still downloads to the cache, it just gets deleted after the move to
Sure, as long as the file is not re-downloaded to the cache if the |
Is your feature request related to a problem? Please describe.
I'd argue this is technically a bug, as the way
file.managed
uses hash comparison is kind of unexpected.So,
file.managed
will always download a remote file to the cache to compare checksums.This is very much not ideal for very large files, and the following scenario is impossible to define via
file.managed
:foo.bar.dat
, should be located at/srv/http/foo.bar.dat
. This is stateful.abc012...
. This is stateful.Being that
source_hash
is required for non-saltfs (salt://
) files, a source is already provided (unlessskip_verify
is explicitly provided). However, this is not used in any way forname
if it exists on the filesystem already and is instead used solely for the cache for transmit integrity validation.The option should be present to have it available for both transmit and local validation, thus:
Describe the solution you'd like
I propose a new boolean argument,
skip_cache
, with a default value of False or None.IF:
skip_cache
is provided/True, the cache will be bypassed entirely for all operations for thisname
/source
pair (unless asalt://
source).name
does not exist on the filesystem, the file will be fetched to the destination, but removed if it does not matchsource_hash
.name
does exist on the filesystem but does not matchsource_hash
, the file will be downloaded directly toname
.Describe alternatives you've considered
There are no alternatives; I am managing many multiple-gigabyte ISO files and stuck in a hellscape of an ever-growing minion cache, please help.
Additional context
N/A
Please Note
Unnecessary; this change should be completely backwards-compat with all existing usages of
file.managed
.The text was updated successfully, but these errors were encountered: