Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
pmem state: document that only .json files matter
Browse files Browse the repository at this point in the history
The implementation already worked like that, it just wasn't documented
and thus it was unknown whether reusing the directory also for other
local state (like the upcoming extra volume mounts) is okay.
  • Loading branch information
pohly committed May 10, 2020
1 parent 65804f6 commit 5fe60ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/pmem-state/pmem-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ var _ StateManager = &fileState{}

// NewFileState instantiates the file state manager with given directory
// location. It ensures the provided directory exists.
// Returns error, if fails to create the directory in case of not pre-existing.
// State entries are mapped to files with the .json suffix in that directory and
// vice versa. Other directory content is ignored, which makes it possible
// to use the directory also for other state information.
func NewFileState(directory string) (StateManager, error) {
if err := ensureLocation(directory); err != nil {
return nil, err
Expand Down

0 comments on commit 5fe60ce

Please sign in to comment.