From a69d635c9b6096e7d5bfdf8ed09395cf044daf99 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 19 Apr 2022 12:04:20 -0700 Subject: [PATCH] Drop unnecessary intermediate variable Signed-off-by: Brad Davidson --- pkg/agent/containerd/config_linux.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/agent/containerd/config_linux.go b/pkg/agent/containerd/config_linux.go index 319119fe87..20697d20db 100644 --- a/pkg/agent/containerd/config_linux.go +++ b/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) if disableCgroup { 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 containerdConfig := templates.ContainerdConfig{ NodeConfig: cfg, DisableCgroup: disableCgroup, - SystemdCgroup: systemdCgroup, + SystemdCgroup: cfg.AgentConfig.Systemd, IsRunningInUserNS: isRunningInUserNS, PrivateRegistryConfig: privRegistries.Registry, ExtraRuntimes: findNvidiaContainerRuntimes(os.DirFS(string(os.PathSeparator))),