From af614c94bd67dcc4346df67f7df5cec3b3fcac0b Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 17 Jun 2025 15:30:04 -0700 Subject: [PATCH] libct/configs: fix/improve deprecation notices The per-file deprecation in cgroup_deprecated.go is not working, let's replace it. Link to Hooks.Run in Hook.Run deprecation notice. Signed-off-by: Kir Kolyshkin (cherry picked from commit b25bcaa8b39d33f46e032e8d980d57358b40d2bd) Signed-off-by: Kir Kolyshkin --- libcontainer/configs/cgroup_deprecated.go | 5 ++++- libcontainer/configs/config.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libcontainer/configs/cgroup_deprecated.go b/libcontainer/configs/cgroup_deprecated.go index 9a7a1a201..7836b240a 100644 --- a/libcontainer/configs/cgroup_deprecated.go +++ b/libcontainer/configs/cgroup_deprecated.go @@ -1,7 +1,8 @@ -package configs // Deprecated: use [github.com/opencontainers/cgroups]. +package configs import "github.com/opencontainers/cgroups" +// Deprecated: use [github.com/opencontainers/cgroups]. type ( Cgroup = cgroups.Cgroup Resources = cgroups.Resources @@ -14,12 +15,14 @@ type ( IfPrioMap = cgroups.IfPrioMap ) +// Deprecated: use [github.com/opencontainers/cgroups]. const ( Undefined = cgroups.Undefined Frozen = cgroups.Frozen Thawed = cgroups.Thawed ) +// Deprecated: use [github.com/opencontainers/cgroups]. var ( NewWeightDevice = cgroups.NewWeightDevice NewThrottleDevice = cgroups.NewThrottleDevice diff --git a/libcontainer/configs/config.go b/libcontainer/configs/config.go index fca95ee58..92773aceb 100644 --- a/libcontainer/configs/config.go +++ b/libcontainer/configs/config.go @@ -458,7 +458,7 @@ type Capabilities struct { Ambient []string } -// Deprecated: use (Hooks).Run instead. +// Deprecated: use [Hooks.Run] instead. func (hooks HookList) RunHooks(state *specs.State) error { for i, h := range hooks { if err := h.Run(state); err != nil {