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

temp dir override for hauler store load #220

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

amartin120
Copy link
Collaborator

@amartin120 amartin120 commented Apr 1, 2024

Please check below, if the PR fulfills these requirements:

  • Commit(s) and code follow the repositories guidelines.
  • Test(s) have been added or updated to support these change(s).
  • Doc(s) have been added or updated to support these change(s).

Associated Links:

Types of Changes:

  • Feature

Proposed Changes:

  • By default hauler store load temporarily copies the contents of its haul to the OS's default TEMP directory in order to maintain an existing store's contents should it exist.

    • On Unix systems, the default is $TMPDIR if non-empty, else /tmp.
    • On Windows, the default is GetTempPath, returning the first non-empty
      value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows directory.
    • On Plan 9, the default is /tmp.
  • Added a new flag to hauler store load called --tempdir or -t that allows the user to override that value if they do not have the ability to modify the ENV that normally controls that.

❯  hauler store load --help                                                                                                                                                                                                                                                                               ─╯
Load a content store from a store archive

Usage:
  hauler store load [flags]

Flags:
  -h, --help             help for load
  -t, --tempdir string   overrides the default directory for temporary files, as returned by your OS.

Global Flags:
      --cache string       (deprecated flag and currently not used)
  -l, --log-level string    (default "info")
  -s, --store string       Location to create store at (default "store")

Verification/Testing of Changes:

  • When overrode via the new flag, the supplied directory is used for temp.
  • When omitting the flag, the normal OS temp dir is used just like today.

Additional Context:

Signed-off-by: Adam Martin <adam.martin@rancherfederal.com>
Signed-off-by: Adam Martin <adam.martin@rancherfederal.com>
@amartin120 amartin120 requested a review from dweomer April 1, 2024 13:53
@amartin120 amartin120 merged commit b18f55e into rancherfederal:main Apr 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Resolved
Development

Successfully merging this pull request may close these issues.

None yet

2 participants