Browse Source

Drop unnecessary intermediate variable

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/5518/head
Brad Davidson 3 years ago committed by Brad Davidson
parent
commit
a69d635c9b
  1. 7
      pkg/agent/containerd/config_linux.go

7
pkg/agent/containerd/config_linux.go

@ -51,16 +51,15 @@ func setupContainerdConfig(ctx context.Context, cfg *config.Node) error {
disableCgroup := isRunningInUserNS && (!controllers["cpu"] || !controllers["pids"] || !cgroupfsWritable) disableCgroup := isRunningInUserNS && (!controllers["cpu"] || !controllers["pids"] || !cgroupfsWritable)
if disableCgroup { if disableCgroup {
logrus.Warn("cgroup v2 controllers are not delegated for rootless. Disabling cgroup.") logrus.Warn("cgroup v2 controllers are not delegated for rootless. Disabling cgroup.")
} else {
cfg.AgentConfig.Systemd = controllers["cpuset"] && os.Getenv("NOTIFY_SOCKET") != ""
} }
systemdCgroup := controllers["cpuset"] && os.Getenv("NOTIFY_SOCKET") != ""
cfg.AgentConfig.Systemd = systemdCgroup
var containerdTemplate string var containerdTemplate string
containerdConfig := templates.ContainerdConfig{ containerdConfig := templates.ContainerdConfig{
NodeConfig: cfg, NodeConfig: cfg,
DisableCgroup: disableCgroup, DisableCgroup: disableCgroup,
SystemdCgroup: systemdCgroup, SystemdCgroup: cfg.AgentConfig.Systemd,
IsRunningInUserNS: isRunningInUserNS, IsRunningInUserNS: isRunningInUserNS,
PrivateRegistryConfig: privRegistries.Registry, PrivateRegistryConfig: privRegistries.Registry,
ExtraRuntimes: findNvidiaContainerRuntimes(os.DirFS(string(os.PathSeparator))), ExtraRuntimes: findNvidiaContainerRuntimes(os.DirFS(string(os.PathSeparator))),

Loading…
Cancel
Save