config

package
v0.0.0-...-ba854f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 87

Documentation

Index

Constants

View Source
const (
	// CgroupfsDriver is cgroupfs driver
	CgroupfsDriver = "cgroupfs"
	// CgroupSystemdDriver is systemd driver
	CgroupSystemdDriver = "systemd"
	// DefaultCgroupDriver is default cgroups driver
	DefaultCgroupDriver = CgroupfsDriver
	// ValidNameChars collects the characters allowed to represent a name, normally used to validate container and volume names.
	ValidNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
)

Variables

View Source
var ValidNamePattern = regexp.MustCompile(`^/?` + ValidNameChars + `+$`)

ValidNamePattern is a regular expression to validate names against the collection of restricted characters.

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.Mutex `json:"-"`

	//Volume config
	VolumeConfig volume.Config `json:"volume-config,omitempty"`

	// Network config
	NetworkConfig network.Config `json:"network-config,omitempty"`

	// Whether enable cri manager.
	IsCriEnabled bool `json:"enable-cri,omitempty"`

	// CRI config.
	CriConfig criconfig.Config `json:"cri-config,omitempty"`

	// Server listening address.
	Listen []string `json:"listen,omitempty"`

	// Debug refers to the log mode.
	Debug bool `json:"debug,omitempty"`

	// ContainerdAddr refers to the unix socket path of containerd.
	ContainerdAddr string `json:"containerd,omitempty"`

	// DefaultRegistry is daemon's default registry which is to pull/push/search images.
	DefaultRegistry string `json:"default-registry,omitempty"`

	// DefaultRegistryNS is daemon's default registry namespace used in pull/push/search images.
	DefaultRegistryNS string `json:"default-registry-namespace,omitempty"`

	// Home directory.
	HomeDir string `json:"home-dir,omitempty"`

	// ContainerdPath is the absolute path of containerd binary,
	// /usr/local/bin is the default.
	ContainerdPath string `json:"containerd-path,omitempty"`

	// TLS configuration
	TLS client.TLSConfig `json:"TLS,omitempty"`

	// Default OCI Runtime
	DefaultRuntime string `json:"default-runtime,omitempty"`

	// Enable lxcfs
	IsLxcfsEnabled bool `json:"enable-lxcfs,omitempty"`

	// LxcfsBinPath is the absolute path of lxcfs binary
	LxcfsBinPath string `json:"lxcfs,omitempty"`

	// LxcfsHome is the absolute path of lxcfs
	LxcfsHome string `json:"lxcfs-home,omitempty"`

	// ImagxeProxy is a http proxy to pull image
	ImageProxy string `json:"image-proxy,omitempty"`

	// QuotaDriver is used to set the driver of Quota
	QuotaDriver string `json:"quota-driver,omitempty"`

	// Configuration file of pouchd
	ConfigFile string `json:"config-file,omitempty"`

	// CgroupParent is to set parent cgroup for all containers
	CgroupParent string `json:"cgroup-parent,omitempty"`

	// Labels is the metadata of daemon
	Labels []string `json:"label,omitempty"`

	// EnableProfiler indicates whether pouchd setup profiler like pprof and stack dumping etc
	EnableProfiler bool `json:"enable-profiler,omitempty"`

	// Pidfile keeps daemon pid
	Pidfile string `json:"pidfile,omitempty"`

	// Default log configuration
	DefaultLogConfig types.LogConfig `json:"default-log-config,omitempty"`

	// RegistryMirrors is a list of registry URLs that act as a mirror for the default registry.
	RegistryMirrors []string `json:"registry-mirrors,omitempty"`

	// oom_score_adj for the daemon
	OOMScoreAdjust int `json:"oom-score-adjust,omitempty"`

	// runtimes config
	Runtimes map[string]types.Runtime `json:"add-runtime,omitempty"`

	// DefaultNamespace is passed to containerd.
	DefaultNamespace string `json:"default-namespace,omitempty"`

	// Snapshotter is passed to containerd, default to overlayfs
	Snapshotter string `json:"snapshotter,omitempty"`

	// AllowMultiSnapshotter allows multi snapshotter, default false
	AllowMultiSnapshotter bool `json:"allow-multi-snapshotter,omitempty"`

	// CgroupDriver sets cgroup driver for all containers
	CgroupDriver string `json:"cgroup-driver,omitempty"`

	// InsecureRegistries sets insecure registries to allow to pull
	// insecure registries.
	InsecureRegistries []string `json:"insecure-registries,omitempty"`

	// EnableBuilder enable builder functionality
	EnableBuilder bool `json:"enable-builder,omitempty"`

	// MachineMemory is the memory limit for a host.
	MachineMemory uint64 `json:"-"`
}

Config refers to daemon's whole configurations.

func (*Config) GetCgroupDriver

func (cfg *Config) GetCgroupDriver() string

GetCgroupDriver gets cgroup driver used in runc.

func (*Config) MergeConfigurations

func (cfg *Config) MergeConfigurations(flagSet *pflag.FlagSet) error

MergeConfigurations merges flagSet flags and config file flags into Config.

func (*Config) UseSystemd

func (cfg *Config) UseSystemd() bool

UseSystemd tells whether use systemd cgroup driver

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the user input config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL