Skip to content

Commit

Permalink
dir: Use .casengine-* temporary directories
Browse files Browse the repository at this point in the history
Tool-specific filenames make tool-specific cleanup easier.  If a
casengine dir handler crashes or is abandoned without the Close()
cleanup, this lets you clean up after it with:

  $ rm -rf /path/to/base/.casengine-*

or similar without having to worry about blowing away non-casengine
content.  More discussion about this use-case and alternative
approaches in [1].

[1]: https://github.com/openSUSE/umoci/pull/198

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Oct 19, 2017
1 parent 45b4b35 commit e40f4b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dir/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r *RegexpGetDigest) GetDigest(path string) (dig digest.Digest, err error)

// New creates a new CAS-engine instance.
func New(ctx context.Context, path string, uri string, getDigest GetDigest) (engine casengine.Engine, err error) {
temp, err := ioutil.TempDir(path, "tmp-")
temp, err := ioutil.TempDir(path, ".casengine-")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e40f4b9

Please sign in to comment.