diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 120f514ef7..cda787b570 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -104,8 +104,8 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory { memory.DisableOOMKiller = config.OomKillDisable } - if config.KernelMemory != 0 { - memory.Kernel = &config.KernelMemory + if config.KernelMemory != 0 { //nolint:staticcheck // ignore SA1019: memory.Kernel is deprecated: kernel-memory limits are not supported in cgroups v2, and were obsoleted in [kernel v5.4]. This field should no longer be used, as it may be ignored by runtimes. + memory.Kernel = &config.KernelMemory //nolint:staticcheck // ignore SA1019: memory.Kernel is deprecated: kernel-memory limits are not supported in cgroups v2, and were obsoleted in [kernel v5.4]. This field should no longer be used, as it may be ignored by runtimes. } if config.KernelMemoryTCP != 0 { diff --git a/daemon/nvidia_linux.go b/daemon/nvidia_linux.go index 9f1c914146..7243b522bc 100644 --- a/daemon/nvidia_linux.go +++ b/daemon/nvidia_linux.go @@ -83,7 +83,13 @@ func setNvidiaGPUs(s *specs.Spec, dev *deviceInstance) error { if s.Hooks == nil { s.Hooks = &specs.Hooks{} } - s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{ + + // This implementation uses prestart hooks, which are deprecated. + // CreateRuntime is the closest equivalent, and executed in the same + // locations as prestart-hooks, but depending on what these hooks do, + // possibly one of the other hooks could be used instead (such as + // CreateContainer or StartContainer). + s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{ //nolint:staticcheck // FIXME(thaJeztah); replace prestart hook with a non-deprecated one. Path: path, Args: []string{ nvidiaHook, diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index 37ad941847..75aecfa45f 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -73,7 +73,7 @@ func withLibnetwork(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Cont s.Hooks = &specs.Hooks{} } shortNetCtlrID := stringid.TruncateID(daemon.netController.ID()) - s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{ + s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{ //nolint:staticcheck // FIXME(thaJeztah); replace prestart hook with a non-deprecated one. Path: filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe"), Args: []string{"libnetwork-setkey", "-exec-root=" + daemonCfg.GetExecRoot(), c.ID, shortNetCtlrID}, }) diff --git a/daemon/update_linux.go b/daemon/update_linux.go index 3105402e3c..8f3bde9eed 100644 --- a/daemon/update_linux.go +++ b/daemon/update_linux.go @@ -59,8 +59,8 @@ func toContainerdResources(resources container.Resources) *libcontainerdtypes.Re if resources.MemoryReservation != 0 { memory.Reservation = &resources.MemoryReservation } - if resources.KernelMemory != 0 { - memory.Kernel = &resources.KernelMemory + if resources.KernelMemory != 0 { //nolint:staticcheck // ignore SA1019: memory.Kernel is deprecated: kernel-memory limits are not supported in cgroups v2, and were obsoleted in [kernel v5.4]. This field should no longer be used, as it may be ignored by runtimes. + memory.Kernel = &resources.KernelMemory //nolint:staticcheck // ignore SA1019: memory.Kernel is deprecated: kernel-memory limits are not supported in cgroups v2, and were obsoleted in [kernel v5.4]. This field should no longer be used, as it may be ignored by runtimes. } if resources.MemorySwap > 0 { memory.Swap = &resources.MemorySwap