diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index 7525198893ff..a8d3a92a4507 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -431,16 +431,18 @@ func get(envInfo *cmds.Agent, proxy proxy.Proxy) (*config.Node, error) { nodeConfig.CACerts = info.CACerts nodeConfig.Containerd.Config = filepath.Join(envInfo.DataDir, "agent", "etc", "containerd", "config.toml") nodeConfig.Containerd.Root = filepath.Join(envInfo.DataDir, "agent", "containerd") - switch nodeConfig.AgentConfig.Snapshotter { - case "overlayfs": - if err := overlay.Supported(nodeConfig.Containerd.Root); err != nil { - 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 { - return nil, errors.Wrapf(err, "\"fuse-overlayfs\" snapshotter cannot be enabled for %q, try using \"native\"", - nodeConfig.Containerd.Root) + if !nodeConfig.Docker && nodeConfig.ContainerRuntimeEndpoint == "" { + switch nodeConfig.AgentConfig.Snapshotter { + case "overlayfs": + if err := overlay.Supported(nodeConfig.Containerd.Root); err != nil { + 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 { + 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")