containerd: add state flag to specify state dir
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
d541567119
commit
dbd3eff1e6
@ -66,6 +66,7 @@ func TestMain(m *testing.M) {
|
|||||||
|
|
||||||
err := ctrd.start("containerd", address, []string{
|
err := ctrd.start("containerd", address, []string{
|
||||||
"--root", defaultRoot,
|
"--root", defaultRoot,
|
||||||
|
"--state", defaultState,
|
||||||
"--log-level", "debug",
|
"--log-level", "debug",
|
||||||
}, buf, buf)
|
}, buf, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
defaultRoot = "/var/lib/containerd-test"
|
defaultRoot = "/var/lib/containerd-test"
|
||||||
|
defaultState = "/run/containerd-test"
|
||||||
defaultAddress = "/run/containerd-test/containerd.sock"
|
defaultAddress = "/run/containerd-test/containerd.sock"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ const (
|
|||||||
var (
|
var (
|
||||||
dockerLayerFolders []string
|
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 {
|
func platformTestSetup(client *Client) error {
|
||||||
|
@ -66,6 +66,10 @@ func main() {
|
|||||||
Name: "root",
|
Name: "root",
|
||||||
Usage: "containerd root directory",
|
Usage: "containerd root directory",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "state",
|
||||||
|
Usage: "containerd state directory",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
configCommand,
|
configCommand,
|
||||||
@ -156,6 +160,10 @@ func applyFlags(context *cli.Context, config *server.Config) error {
|
|||||||
name: "root",
|
name: "root",
|
||||||
d: &config.Root,
|
d: &config.Root,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "state",
|
||||||
|
d: &config.State,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "address",
|
name: "address",
|
||||||
d: &config.GRPC.Address,
|
d: &config.GRPC.Address,
|
||||||
|
Loading…
Reference in New Issue
Block a user