Set state directory using config instead of hardcoding

Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
Matthew Heon 2017-04-07 14:26:27 -04:00
parent b14e2d2937
commit 1d4421af49

View file

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"path/filepath"
"github.com/containers/image/types" "github.com/containers/image/types"
sstorage "github.com/containers/storage/storage" sstorage "github.com/containers/storage/storage"
@ -75,8 +76,8 @@ func New(config *Config) (*Server, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
// HACK HACK HACK TODO MAKE CONFIGURABLE // TODO: Should we put this elsewhere? Separate directory specified in the config?
state, err := state.NewFileState("/tmp/crio_state_test", r) state, err := state.NewFileState(filepath.Join(config.RunRoot, "ocid_state"), r)
if err != nil { if err != nil {
return nil, err return nil, err
} }