From f922f2ae3c87005544e8d469a1b749249ea03b24 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy <84944216+helsaawy@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:58:41 -0500 Subject: [PATCH] Omnibus dependency updates (#2051) Consolidate dependabot updates: - github.com/microsoft/hcsshim/pull/2050 - github.com/microsoft/hcsshim/pull/2048 - github.com/microsoft/hcsshim/pull/2047 - github.com/microsoft/hcsshim/pull/2046 - github.com/microsoft/hcsshim/pull/2045 - github.com/microsoft/hcsshim/pull/2044 - github.com/microsoft/hcsshim/pull/2043 - github.com/microsoft/hcsshim/pull/2042 Signed-off-by: Hamza El-Saawy (cherry picked from commit 060de7cb9b4a420e824c50b299bf608cdda50ea6) Signed-off-by: Kirtana Ashok --- internal/hooks/spec.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/hooks/spec.go b/internal/hooks/spec.go index 51ba3aa592..ba53496e6b 100644 --- a/internal/hooks/spec.go +++ b/internal/hooks/spec.go @@ -16,8 +16,9 @@ const ( // Prestart commands are executed after the container namespaces are created, // but before the user supplied command is executed from init. - // Note: This hook is now deprecated // Prestart commands are called in the Runtime namespace. + // + // Deprecated: use [CreateRuntime] instead. Prestart HookName = "prestart" // CreateRuntime commands MUST be called as part of the create operation after @@ -27,7 +28,7 @@ const ( CreateRuntime HookName = "createRuntime" ) -// NewOCIHook creates a new oci.Hook with given parameters +// NewOCIHook creates a new oci.Hook with given parameters. func NewOCIHook(path string, args, env []string) oci.Hook { return oci.Hook{ Path: path, @@ -36,14 +37,12 @@ func NewOCIHook(path string, args, env []string) oci.Hook { } } -// AddOCIHook adds oci.Hook of the given hook name to spec +// AddOCIHook adds oci.Hook of the given hook name to spec. func AddOCIHook(spec *oci.Spec, hn HookName, hk oci.Hook) error { if spec.Hooks == nil { spec.Hooks = &oci.Hooks{} } switch hn { - case Prestart: - spec.Hooks.Prestart = append(spec.Hooks.Prestart, hk) case CreateRuntime: spec.Hooks.CreateRuntime = append(spec.Hooks.CreateRuntime, hk) default: