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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-06-17 15:30:04 -07:00
parent a10d338eb2
commit b25bcaa8b3
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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
+1 -1
View File
@@ -458,7 +458,7 @@ type Capabilities struct {
Ambient []string `json:"Ambient,omitempty"`
}
// 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 {