defaults: add DefaultConfigDir
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
e231b955dd
commit
9a7ca39cbd
@ -27,6 +27,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/defaults"
|
||||
"github.com/containerd/containerd/errdefs"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/mount"
|
||||
@ -80,7 +81,7 @@ can be used and modified as necessary as a custom configuration.`
|
||||
cli.StringFlag{
|
||||
Name: "config,c",
|
||||
Usage: "path to the configuration file",
|
||||
Value: defaultConfigPath,
|
||||
Value: filepath.Join(defaults.DefaultConfigDir, "config.toml"),
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "log-level,l",
|
||||
|
@ -27,8 +27,6 @@ import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const defaultConfigPath = "/etc/containerd/config.toml"
|
||||
|
||||
var handledSignals = []os.Signal{
|
||||
unix.SIGTERM,
|
||||
unix.SIGINT,
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"unsafe"
|
||||
|
||||
"github.com/Microsoft/go-winio/pkg/etw"
|
||||
@ -33,8 +32,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
defaultConfigPath = filepath.Join(os.Getenv("programfiles"), "containerd", "config.toml")
|
||||
handledSignals = []os.Signal{
|
||||
handledSignals = []os.Signal{
|
||||
windows.SIGTERM,
|
||||
windows.SIGINT,
|
||||
}
|
||||
|
@ -34,4 +34,6 @@ const (
|
||||
DefaultFIFODir = "/run/containerd/fifo"
|
||||
// DefaultRuntime is the default linux runtime
|
||||
DefaultRuntime = "io.containerd.runc.v2"
|
||||
// DefaultConfigDir is the default location for config files.
|
||||
DefaultConfigDir = "/etc/containerd"
|
||||
)
|
||||
|
@ -30,6 +30,9 @@ var (
|
||||
// DefaultStateDir is the default location used by containerd to store
|
||||
// transient data
|
||||
DefaultStateDir = filepath.Join(os.Getenv("ProgramData"), "containerd", "state")
|
||||
|
||||
// DefaultConfigDir is the default location for config files.
|
||||
DefaultConfigDir = filepath.Join(os.Getenv("programfiles"), "containerd")
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user