containerd: add state flag to specify state dir

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-08-18 09:10:44 -07:00
parent d541567119
commit dbd3eff1e6
No known key found for this signature in database
GPG Key ID: 40CF16616B361216
4 changed files with 12 additions and 1 deletions

View File

@ -66,6 +66,7 @@ func TestMain(m *testing.M) {
err := ctrd.start("containerd", address, []string{
"--root", defaultRoot,
"--state", defaultState,
"--log-level", "debug",
}, buf, buf)
if err != nil {

View File

@ -8,6 +8,7 @@ import (
const (
defaultRoot = "/var/lib/containerd-test"
defaultState = "/run/containerd-test"
defaultAddress = "/run/containerd-test/containerd.sock"
)

View File

@ -18,6 +18,7 @@ var (
dockerLayerFolders []string
defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test")
defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test")
)
func platformTestSetup(client *Client) error {

View File

@ -66,6 +66,10 @@ func main() {
Name: "root",
Usage: "containerd root directory",
},
cli.StringFlag{
Name: "state",
Usage: "containerd state directory",
},
}
app.Commands = []cli.Command{
configCommand,
@ -156,6 +160,10 @@ func applyFlags(context *cli.Context, config *server.Config) error {
name: "root",
d: &config.Root,
},
{
name: "state",
d: &config.State,
},
{
name: "address",
d: &config.GRPC.Address,