go.mod: github.com/Microsoft/hcsshim v0.10.0-rc.7

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2023-03-07 21:48:06 +09:00
parent c77ddf5381
commit da1ffdd757
17 changed files with 483 additions and 12 deletions

View File

@@ -45,6 +45,8 @@ func ExportLayer(ctx context.Context, path string, exportFolderPath string, pare
type LayerReader interface {
// Next advances to the next file and returns the name, size, and file info
Next() (string, int64, *winio.FileBasicInfo, error)
// LinkInfo returns the number of links and the file identifier for the current file.
LinkInfo() (uint32, *winio.FileIDInfo, error)
// Read reads data from the current file, in the format of a Win32 backup stream, and
// returns the number of bytes read.
Read(b []byte) (int, error)
@@ -67,6 +69,11 @@ func NewLayerReader(ctx context.Context, path string, parentLayerPaths []string)
trace.StringAttribute("path", path),
trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
if len(parentLayerPaths) == 0 {
// This is a base layer. It gets exported differently.
return newBaseLayerReader(path, span), nil
}
exportPath, err := os.MkdirTemp("", "hcs")
if err != nil {
return nil, err