From 87b0804345c8fe8b63c64bee4db7cd8d304f6162 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Wed, 4 Mar 2026 20:42:35 +1100 Subject: [PATCH] libct: remove deprecated HooksList.RunHooks This was deprecated in commit e6a4870e4ac40 ("libct: better errors for hooks"), and users have had ample time to migrate to Hooks.Run since. Signed-off-by: Aleksa Sarai --- CHANGELOG.md | 1 + libcontainer/configs/config.go | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c726b29..4fdb2cb92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `libcontainer/configs.Thawed` - `libcontainer/configs.NewWeightDevice` - `libcontainer/configs.NewThrottleDevice` + - `libcontainer/configs.HookList.RunHooks` (#5141) ## [1.4.0] - 2025-11-27 diff --git a/libcontainer/configs/config.go b/libcontainer/configs/config.go index 6141c018f..b8f2321c2 100644 --- a/libcontainer/configs/config.go +++ b/libcontainer/configs/config.go @@ -466,17 +466,6 @@ type Capabilities struct { Ambient []string `json:"Ambient,omitempty"` } -// 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 { - return fmt.Errorf("error running hook #%d: %w", i, err) - } - } - - return nil -} - func (hooks *Hooks) UnmarshalJSON(b []byte) error { var state map[HookName][]CommandHook