Drop unnecessary intermediate variable

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2022-04-19 12:04:20 -07:00 committed by Brad Davidson
parent 333311c7ee
commit a69d635c9b

View File

@ -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))),