-
Notifications
You must be signed in to change notification settings - Fork 767
Expand file tree
/
Copy pathconfig.go
More file actions
79 lines (71 loc) · 2.92 KB
/
config.go
File metadata and controls
79 lines (71 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package config
import (
"github.com/containerd/containerd/v2/defaults"
"github.com/containerd/containerd/v2/pkg/namespaces"
ncdefaults "github.com/containerd/nerdctl/v2/pkg/defaults"
)
// Config corresponds to nerdctl.toml .
// See docs/config.md .
type Config struct {
Debug bool `toml:"debug"`
DebugFull bool `toml:"debug_full"`
Address string `toml:"address"`
Namespace string `toml:"namespace"`
Snapshotter string `toml:"snapshotter"`
CNIPath string `toml:"cni_path"`
CNINetConfPath string `toml:"cni_netconfpath"`
DataRoot string `toml:"data_root"`
CgroupManager string `toml:"cgroup_manager"`
InsecureRegistry bool `toml:"insecure_registry"`
HostsDir []string `toml:"hosts_dir"`
Experimental bool `toml:"experimental"`
HostGatewayIP string `toml:"host_gateway_ip"`
BridgeIP string `toml:"bridge_ip, omitempty"`
KubeHideDupe bool `toml:"kube_hide_dupe"`
CDISpecDirs []string `toml:"cdi_spec_dirs,omitempty"` // CDISpecDirs is a list of directories in which CDI specifications can be found.
UsernsRemap string `toml:"userns_remap, omitempty"`
DNS []string `toml:"dns,omitempty"`
DNSOpts []string `toml:"dns_opts,omitempty"`
DNSSearch []string `toml:"dns_search,omitempty"`
DisableHCSystemd bool `toml:"disable_hc_systemd"`
SelinuxEnabled bool `toml:"selinux_enabled"`
}
// New creates a default Config object statically,
// without interpolating CLI flags, env vars, and toml.
func New() *Config {
return &Config{
Debug: false,
DebugFull: false,
Address: defaults.DefaultAddress,
Namespace: namespaces.Default,
Snapshotter: defaults.DefaultSnapshotter,
CNIPath: ncdefaults.CNIPath(),
CNINetConfPath: ncdefaults.CNINetConfPath(),
DataRoot: ncdefaults.DataRoot(),
CgroupManager: ncdefaults.CgroupManager(),
InsecureRegistry: false,
SelinuxEnabled: false,
HostsDir: ncdefaults.HostsDirs(),
Experimental: true,
HostGatewayIP: ncdefaults.HostGatewayIP(),
KubeHideDupe: false,
CDISpecDirs: ncdefaults.CDISpecDirs(),
UsernsRemap: "",
DNS: []string{},
DNSOpts: []string{},
DNSSearch: []string{},
DisableHCSystemd: false,
}
}