Skip to content

Commit

Permalink
Omnibus dependency updates (#2051)
Browse files Browse the repository at this point in the history
Consolidate dependabot updates:
 - github.com//pull/2050
 - github.com//pull/2048
 - github.com//pull/2047
 - github.com//pull/2046
 - github.com//pull/2045
 - github.com//pull/2044
 - github.com//pull/2043
 - github.com//pull/2042

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
(cherry picked from commit 060de7c)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
  • Loading branch information
helsaawy authored and kiashok committed Aug 19, 2024
1 parent 7d25ce2 commit f922f2a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/hooks/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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:
Expand Down

0 comments on commit f922f2a

Please sign in to comment.