Add a Windows section for Linux oci on LCOW
When creating a default OCI spec on Windows that is targeting the LCOW platform it needs to contain a Windows section as well. This adds the Windows section by default. It also protects against this case for all OCI creation that doesnt use the OCI package in the runhcs-shim. Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
@@ -314,6 +314,14 @@ func writeMountsToConfig(bundle string, mounts []*containerd_types.Mount) error
|
||||
return errors.Wrap(err, "failed to seek to 0 in config.json")
|
||||
}
|
||||
|
||||
// If we are creating LCOW make sure that spec.Windows is filled out before
|
||||
// appending layer folders.
|
||||
if m.Type == "lcow-layer" && spec.Windows == nil {
|
||||
spec.Windows = &oci.Windows{
|
||||
HyperV: &oci.WindowsHyperV{},
|
||||
}
|
||||
}
|
||||
|
||||
// Append the parents
|
||||
spec.Windows.LayerFolders = append(spec.Windows.LayerFolders, parentLayerPaths...)
|
||||
// Append the scratch
|
||||
|
||||
Reference in New Issue
Block a user