diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index c589c5ea88..734f842a70 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -101,8 +101,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..63c27a464e 100644 --- a/daemon/nvidia_linux.go +++ b/daemon/nvidia_linux.go @@ -83,7 +83,7 @@ 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{ + s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{ //nolint:staticcheck // ignore SA1019 Path: path, Args: []string{ nvidiaHook, diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index 3ab7fc5785..16e9850d1d 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -72,7 +72,7 @@ func WithLibnetwork(daemon *Daemon, c *container.Container) coci.SpecOpts { if ns.Type == "network" && ns.Path == "" && !c.Config.NetworkDisabled { target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe") 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 // ignore SA1019 Path: target, Args: []string{ "libnetwork-setkey", 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