Browse Source

Do not validate snapshotter argument if docker is enabled

Problem:
While using ZFS on debian and K3s with docker, I am unable to get k3s working as the snapshotter value is being validated and the validation fails.

Solution:
We should not validate snapshotter value if we are using docker as it's a no-op in that case.

Signed-off-by: Waqar Ahmed <waqarahmedjoyia@live.com>
pull/2835/head
Waqar Ahmed 4 years ago committed by Brad Davidson
parent
commit
3ea696815b
  1. 22
      pkg/agent/config/config.go

22
pkg/agent/config/config.go

@ -433,16 +433,18 @@ func get(envInfo *cmds.Agent, proxy proxy.Proxy) (*config.Node, error) {
nodeConfig.CACerts = info.CACerts nodeConfig.CACerts = info.CACerts
nodeConfig.Containerd.Config = filepath.Join(envInfo.DataDir, "agent", "etc", "containerd", "config.toml") nodeConfig.Containerd.Config = filepath.Join(envInfo.DataDir, "agent", "etc", "containerd", "config.toml")
nodeConfig.Containerd.Root = filepath.Join(envInfo.DataDir, "agent", "containerd") nodeConfig.Containerd.Root = filepath.Join(envInfo.DataDir, "agent", "containerd")
switch nodeConfig.AgentConfig.Snapshotter { if !nodeConfig.Docker && nodeConfig.ContainerRuntimeEndpoint == "" {
case "overlayfs": switch nodeConfig.AgentConfig.Snapshotter {
if err := overlay.Supported(nodeConfig.Containerd.Root); err != nil { case "overlayfs":
return nil, errors.Wrapf(err, "\"overlayfs\" snapshotter cannot be enabled for %q, try using \"fuse-overlayfs\" or \"native\"", if err := overlay.Supported(nodeConfig.Containerd.Root); err != nil {
nodeConfig.Containerd.Root) return nil, errors.Wrapf(err, "\"overlayfs\" snapshotter cannot be enabled for %q, try using \"fuse-overlayfs\" or \"native\"",
} nodeConfig.Containerd.Root)
case "fuse-overlayfs": }
if err := fuseoverlayfs.Supported(nodeConfig.Containerd.Root); err != nil { case "fuse-overlayfs":
return nil, errors.Wrapf(err, "\"fuse-overlayfs\" snapshotter cannot be enabled for %q, try using \"native\"", if err := fuseoverlayfs.Supported(nodeConfig.Containerd.Root); err != nil {
nodeConfig.Containerd.Root) return nil, errors.Wrapf(err, "\"fuse-overlayfs\" snapshotter cannot be enabled for %q, try using \"native\"",
nodeConfig.Containerd.Root)
}
} }
} }
nodeConfig.Containerd.Opt = filepath.Join(envInfo.DataDir, "agent", "containerd") nodeConfig.Containerd.Opt = filepath.Join(envInfo.DataDir, "agent", "containerd")

Loading…
Cancel
Save