X Tutup
Skip to content

Commit 7361b19

Browse files
committed
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>
1 parent 4c9b5ef commit 7361b19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

diff/lcow/lcow.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"path"
2626
"time"
2727

28+
"github.com/Microsoft/go-winio/pkg/security"
2829
"github.com/Microsoft/hcsshim/ext4/tar2ext4"
2930
"github.com/containerd/containerd/archive/compression"
3031
"github.com/containerd/containerd/content"
@@ -142,7 +143,6 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
142143
if err != nil {
143144
return emptyDesc, err
144145
}
145-
defer outFile.Close()
146146
defer func() {
147147
if err != nil {
148148
outFile.Close()
@@ -154,6 +154,12 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
154154
if err != nil {
155155
return emptyDesc, errors.Wrapf(err, "failed to convert tar to ext4 vhd")
156156
}
157+
outFile.Close()
158+
159+
err = security.GrantVmGroupAccess(layerPath)
160+
if err != nil {
161+
return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath)
162+
}
157163

158164
return ocispec.Descriptor{
159165
MediaType: ocispec.MediaTypeImageLayer,

0 commit comments

Comments
 (0)
X Tutup