Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

WIP: adds a simple layer cache. #102

Closed
wants to merge 1 commit into from

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Sep 22, 2017

No description provided.

}

func NewFileCache(rootDir string) (*FileCache, error) {
if err := os.MkdirAll(rootDir, 0700); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big deal, but maybe make this 600? shouldn't need exec permissions on anything in here, just R/W

}
if _, err := io.Copy(l, r); err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you're getting a new layer after adding to the cache, should you r.Close() here?

@nkubala
Copy link
Contributor

nkubala commented Sep 22, 2017

Does this cache have a lifecycle? If I create a few ImagePreppers will they all share the same cache directory? This is probably fine, but if so we should be careful of race conditions since all these are actually doing is reading/writing files

@nkubala nkubala mentioned this pull request Oct 16, 2017
@dlorenc dlorenc closed this Oct 20, 2017
@dlorenc dlorenc deleted the cache branch October 20, 2017 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants