mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 05:04:26 +00:00
katautils: Run the preStart hook in the host namespace
The OCI spec is very specific about it: "The prestart hooks MUST be executed in the runtime namespace." Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
This commit is contained in:
parent
6be6d0a3b3
commit
d9dfce1453
@ -155,11 +155,8 @@ func CreateSandbox(ctx context.Context, vci vc.VC, ociSpec specs.Spec, runtimeCo
|
||||
}
|
||||
}()
|
||||
|
||||
// Run pre-start OCI hooks.
|
||||
err = EnterNetNS(sandboxConfig.NetworkConfig.NetworkID, func() error {
|
||||
return PreStartHooks(ctx, ociSpec, containerID, bundlePath)
|
||||
})
|
||||
if err != nil {
|
||||
// Run pre-start OCI hooks, in the runtime namespace.
|
||||
if err := PreStartHooks(ctx, ociSpec, containerID, bundlePath); err != nil {
|
||||
return nil, vc.Process{}, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user