Use defaults pkg for all platforms
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
90a6b79bfc
commit
6bf779c589
@ -2,18 +2,21 @@
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/containerd/containerd/server"
|
||||
import (
|
||||
"github.com/containerd/containerd/defaults"
|
||||
"github.com/containerd/containerd/server"
|
||||
)
|
||||
|
||||
func defaultConfig() *server.Config {
|
||||
return &server.Config{
|
||||
Root: server.DefaultRootDir,
|
||||
State: server.DefaultStateDir,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: server.GRPCConfig{
|
||||
Address: server.DefaultAddress,
|
||||
Address: defaults.DefaultAddress,
|
||||
},
|
||||
Debug: server.Debug{
|
||||
Level: "info",
|
||||
Address: server.DefaultDebugAddress,
|
||||
Address: defaults.DefaultDebugAddress,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,20 @@
|
||||
package main
|
||||
|
||||
import "github.com/containerd/containerd/server"
|
||||
import (
|
||||
"github.com/containerd/containerd/defaults"
|
||||
"github.com/containerd/containerd/server"
|
||||
)
|
||||
|
||||
func defaultConfig() *server.Config {
|
||||
return &server.Config{
|
||||
Root: server.DefaultRootDir,
|
||||
State: server.DefaultStateDir,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: server.GRPCConfig{
|
||||
Address: server.DefaultAddress,
|
||||
Address: defaults.DefaultAddress,
|
||||
},
|
||||
Debug: server.Debug{
|
||||
Level: "info",
|
||||
Address: server.DefaultDebugAddress,
|
||||
Address: defaults.DefaultDebugAddress,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package defaults provides several common defaults for interacting wtih
|
||||
// containerd. These can be used on the client-side or server-side.
|
||||
// +build !windows
|
||||
|
||||
package defaults
|
||||
|
||||
const (
|
24
defaults/defaults_windows.go
Normal file
24
defaults/defaults_windows.go
Normal file
@ -0,0 +1,24 @@
|
||||
// +build windows
|
||||
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultRootDir is the default location used by containerd to store
|
||||
// persistent data
|
||||
DefaultRootDir = filepath.Join(os.Getenv("programfiles"), "containerd", "root")
|
||||
// DefaultStateDir is the default location used by containerd to store
|
||||
// transient data
|
||||
DefaultStateDir = filepath.Join(os.Getenv("programfiles"), "containerd", "state")
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultAddress is the default winpipe address
|
||||
DefaultAddress = `\\.\pipe\containerd-containerd`
|
||||
// DefaultDebugAddress is the default winpipe address for pprof data
|
||||
DefaultDebugAddress = `\\.\pipe\containerd-debug`
|
||||
)
|
3
defaults/doc.go
Normal file
3
defaults/doc.go
Normal file
@ -0,0 +1,3 @@
|
||||
// Package defaults provides several common defaults for interacting wtih
|
||||
// containerd. These can be used on the client-side or server-side.
|
||||
package defaults
|
@ -2,13 +2,6 @@ package server
|
||||
|
||||
import "context"
|
||||
|
||||
const (
|
||||
// DefaultAddress is the default unix socket address
|
||||
DefaultAddress = "/var/run/containerd/containerd.sock"
|
||||
// DefaultDebugAddress is the default unix socket address for pprof data
|
||||
DefaultDebugAddress = "/var/run/containerd/debug.sock"
|
||||
)
|
||||
|
||||
func apply(_ context.Context, _ *Config) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -4,19 +4,6 @@ package server
|
||||
|
||||
import "context"
|
||||
|
||||
const (
|
||||
// DefaultRootDir is the default location used by containerd to store
|
||||
// persistent data
|
||||
DefaultRootDir = "/var/lib/containerd"
|
||||
// DefaultStateDir is the default location used by containerd to store
|
||||
// transient data
|
||||
DefaultStateDir = "/run/containerd"
|
||||
// DefaultAddress is the default unix socket address
|
||||
DefaultAddress = "/run/containerd/containerd.sock"
|
||||
// DefaultDebugAddress is the default unix socket address for pprof data
|
||||
DefaultDebugAddress = "/run/containerd/debug.sock"
|
||||
)
|
||||
|
||||
func apply(_ context.Context, _ *Config) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -4,24 +4,6 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultRootDir is the default location used by containerd to store
|
||||
// persistent data
|
||||
DefaultRootDir = filepath.Join(os.Getenv("programfiles"), "containerd", "root")
|
||||
// DefaultStateDir is the default location used by containerd to store
|
||||
// transient data
|
||||
DefaultStateDir = filepath.Join(os.Getenv("programfiles"), "containerd", "state")
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultAddress is the default winpipe address
|
||||
DefaultAddress = `\\.\pipe\containerd-containerd`
|
||||
// DefaultDebugAddress is the default winpipe address for pprof data
|
||||
DefaultDebugAddress = `\\.\pipe\containerd-debug`
|
||||
)
|
||||
|
||||
func apply(_ context.Context, _ *Config) error {
|
||||
|
Loading…
Reference in New Issue
Block a user