Add cimfs differ and snapshotter
Details about CimFs project are discussed in #8346 Signed-off-by: Amit Barve <ambarve@microsoft.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
"github.com/Microsoft/hcsshim/pkg/ociwclayer"
|
||||
ocicimlayer "github.com/Microsoft/hcsshim/pkg/ociwclayer/cim"
|
||||
)
|
||||
|
||||
// applyWindowsLayer applies a tar stream of an OCI style diff tar of a Windows layer
|
||||
@@ -77,3 +78,16 @@ func WithParentLayers(p []string) WriteDiffOpt {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func applyWindowsCimLayer(ctx context.Context, root string, r io.Reader, options ApplyOptions) (size int64, err error) {
|
||||
return ocicimlayer.ImportCimLayerFromTar(ctx, r, root, options.Parents)
|
||||
}
|
||||
|
||||
// AsCimContainerLayer indicates that the tar stream to apply is that of a Windows container Layer written in
|
||||
// the cim format.
|
||||
func AsCimContainerLayer() ApplyOpt {
|
||||
return func(options *ApplyOptions) error {
|
||||
options.applyFunc = applyWindowsCimLayer
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user