Update Windows lcow differ to set NT VIRTUAL MACHINE\Virtual Machines SID
For LCOW using the Virtual Machines SID for the shared read-only layers improves overall performance avoiding the need to set per VM access at runtime. Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
parent
4c9b5ef8ea
commit
7361b19875
@ -25,6 +25,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/Microsoft/go-winio/pkg/security"
|
||||||
"github.com/Microsoft/hcsshim/ext4/tar2ext4"
|
"github.com/Microsoft/hcsshim/ext4/tar2ext4"
|
||||||
"github.com/containerd/containerd/archive/compression"
|
"github.com/containerd/containerd/archive/compression"
|
||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
@ -142,7 +143,6 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return emptyDesc, err
|
return emptyDesc, err
|
||||||
}
|
}
|
||||||
defer outFile.Close()
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
outFile.Close()
|
outFile.Close()
|
||||||
@ -154,6 +154,12 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return emptyDesc, errors.Wrapf(err, "failed to convert tar to ext4 vhd")
|
return emptyDesc, errors.Wrapf(err, "failed to convert tar to ext4 vhd")
|
||||||
}
|
}
|
||||||
|
outFile.Close()
|
||||||
|
|
||||||
|
err = security.GrantVmGroupAccess(layerPath)
|
||||||
|
if err != nil {
|
||||||
|
return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath)
|
||||||
|
}
|
||||||
|
|
||||||
return ocispec.Descriptor{
|
return ocispec.Descriptor{
|
||||||
MediaType: ocispec.MediaTypeImageLayer,
|
MediaType: ocispec.MediaTypeImageLayer,
|
||||||
|
Loading…
Reference in New Issue
Block a user