mirror of
https://github.com/containers/podman.git
synced 2025-06-26 21:07:02 +08:00
Merge pull request #16434 from flouthoc/wasm-hook
specgen,wasm: switch to crun-wasm wherever applicable
This commit is contained in:
@ -142,6 +142,17 @@ func WithOCIRuntime(runtime string) RuntimeOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithCtrOCIRuntime specifies an OCI runtime in container's config.
|
||||
func WithCtrOCIRuntime(runtime string) CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
ctr.config.OCIRuntime = runtime
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithConmonPath specifies the path to the conmon binary which manages the
|
||||
// runtime.
|
||||
func WithConmonPath(path string) RuntimeOption {
|
||||
|
@ -122,6 +122,16 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
if imageData != nil {
|
||||
ociRuntimeVariant := rtc.Engine.ImagePlatformToRuntime(imageData.Os, imageData.Architecture)
|
||||
// Don't unnecessarily set and invoke additional libpod
|
||||
// option if OCI runtime is still default.
|
||||
if ociRuntimeVariant != rtc.Engine.OCIRuntime {
|
||||
options = append(options, libpod.WithCtrOCIRuntime(ociRuntimeVariant))
|
||||
}
|
||||
}
|
||||
|
||||
if newImage != nil {
|
||||
// If the input name changed, we could properly resolve the
|
||||
// image. Otherwise, it must have been an ID where we're
|
||||
|
Reference in New Issue
Block a user