Skip to content

Commit

Permalink
containerd: add state flag to specify state dir
Browse files Browse the repository at this point in the history
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
  • Loading branch information
mlaventure committed Aug 29, 2017
1 parent d541567 commit dbd3eff
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions client_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

const (
defaultRoot = "/var/lib/containerd-test"
defaultState = "/run/containerd-test"
defaultAddress = "/run/containerd-test/containerd.sock"
)

Expand Down
3 changes: 2 additions & 1 deletion client_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const (
var (
dockerLayerFolders []string

defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test")
defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test")
defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test")
)

func platformTestSetup(client *Client) error {
Expand Down
8 changes: 8 additions & 0 deletions cmd/containerd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit dbd3eff

Please sign in to comment.