Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = Settings{ ConfigPath: "/etc/containerd/config.toml", Setup: func(_ Env) error { return nil }, Restarter: containerd.NewDefaultRestarter(), }
View Source
var K0s = Default.WithConfigPath("/etc/k0s/containerd.d/config.toml"). WithRestarter(containerd.K0sRestarter{}). WithSetup(func(env Env) error { _, err := env.HostFs.Stat(env.ConfigPath) if err == nil { return nil } if errors.Is(err, os.ErrNotExist) { _, err := env.HostFs.Create(env.ConfigPath) if err != nil { return err } return nil } return err })
View Source
var K3s = RKE2.WithConfigPath("/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl"). WithRestarter(containerd.K3sRestarter{})
View Source
var MicroK8s = Default.WithConfigPath("/var/snap/microk8s/current/args/containerd-template.toml"). WithRestarter(containerd.MicroK8sRestarter{})
View Source
var RKE2 = Default.WithConfigPath("/var/lib/rancher/rke2/agent/etc/containerd/config.toml.tmpl"). WithRestarter(containerd.RKE2Restarter{}). WithSetup(func(env Env) error { _, err := env.HostFs.Stat(env.ConfigPath) if err == nil { return nil } if errors.Is(err, os.ErrNotExist) { src, _ := strings.CutSuffix(env.ConfigPath, ".tmpl") in, err := env.HostFs.Open(src) if err != nil { return err } defer in.Close() out, err := env.HostFs.Create(env.ConfigPath) if err != nil { return err } defer func() { cerr := out.Close() if err == nil { err = cerr } }() if _, err = io.Copy(out, in); err != nil { return err } err = out.Sync() return nil } return err })
Functions ¶
This section is empty.
Types ¶
type Settings ¶
type Settings struct {
ConfigPath string
Setup func(Env) error
Restarter containerd.Restarter
}
func (Settings) WithConfigPath ¶
func (Settings) WithRestarter ¶
func (s Settings) WithRestarter(restarter containerd.Restarter) Settings
Click to show internal directories.
Click to hide internal directories.