From 5fe60ce08e21d711ddbda3aeebfa76889b0266f5 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 26 Feb 2020 17:01:38 +0100 Subject: [PATCH] pmem state: document that only .json files matter 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. --- pkg/pmem-state/pmem-state.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/pmem-state/pmem-state.go b/pkg/pmem-state/pmem-state.go index b27b6f25ac..22370eb951 100644 --- a/pkg/pmem-state/pmem-state.go +++ b/pkg/pmem-state/pmem-state.go @@ -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