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