go.mod: Bump hcsshim to v0.10.0-rc.1

This contains quite a bit (also bumps google/uuid to 1.3.0). Some HostProcess
container improvements to get ready for whenever it goes to stable in
Kubernetes, Hyper-V (windows) container support for CRI, and a plethora of
other small additions and fixes.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
This commit is contained in:
Daniel Canter
2022-08-12 23:43:27 -07:00
parent a04268132e
commit 1f8db2467b
168 changed files with 3532 additions and 1131 deletions

View File

@@ -0,0 +1 @@
package runhcs

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (
@@ -20,7 +22,7 @@ type Format string
const (
none Format = ""
// Text is the default text log ouput.
// Text is the default text log output.
Text Format = "text"
// JSON is the JSON formatted log output.
JSON Format = "json"
@@ -140,7 +142,7 @@ func (r *Runhcs) runOrError(cmd *exec.Cmd) error {
}
status, err := runc.Monitor.Wait(cmd, ec)
if err == nil && status != 0 {
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0])
}
return err
}
@@ -166,7 +168,7 @@ func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) {
status, err := runc.Monitor.Wait(cmd, ec)
if err == nil && status != 0 {
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0])
}
return b.Bytes(), err

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (
@@ -95,7 +97,7 @@ func (r *Runhcs) Create(context context.Context, id, bundle string, opts *Create
}
status, err := runc.Monitor.Wait(cmd, ec)
if err == nil && status != 0 {
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0])
}
return err
}

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (
@@ -82,7 +84,7 @@ func (r *Runhcs) Exec(context context.Context, id, processFile string, opts *Exe
}
status, err := runc.Monitor.Wait(cmd, ec)
if err == nil && status != 0 {
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0])
}
return err
}

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -1,3 +1,5 @@
//go:build windows
package runhcs
import (

View File

@@ -0,0 +1,3 @@
// Package ociwclayer provides functions for importing and exporting Windows
// container layers from and to their OCI tar representation.
package ociwclayer

View File

@@ -1,5 +1,5 @@
// Package ociwclayer provides functions for importing and exporting Windows
// container layers from and to their OCI tar representation.
//go:build windows
package ociwclayer
import (
@@ -9,11 +9,9 @@ import (
"path/filepath"
"github.com/Microsoft/go-winio/backuptar"
"github.com/Microsoft/hcsshim"
"github.com/Microsoft/hcsshim/internal/wclayer"
)
var driverInfo = hcsshim.DriverInfo{}
// ExportLayerToTar writes an OCI layer tar stream from the provided on-disk layer.
// The caller must specify the parent layers, if any, ordered from lowest to
// highest layer.
@@ -21,25 +19,25 @@ var driverInfo = hcsshim.DriverInfo{}
// The layer will be mounted for this process, so the caller should ensure that
// it is not currently mounted.
func ExportLayerToTar(ctx context.Context, w io.Writer, path string, parentLayerPaths []string) error {
err := hcsshim.ActivateLayer(driverInfo, path)
err := wclayer.ActivateLayer(ctx, path)
if err != nil {
return err
}
defer func() {
_ = hcsshim.DeactivateLayer(driverInfo, path)
_ = wclayer.DeactivateLayer(ctx, path)
}()
// Prepare and unprepare the layer to ensure that it has been initialized.
err = hcsshim.PrepareLayer(driverInfo, path, parentLayerPaths)
err = wclayer.PrepareLayer(ctx, path, parentLayerPaths)
if err != nil {
return err
}
err = hcsshim.UnprepareLayer(driverInfo, path)
err = wclayer.UnprepareLayer(ctx, path)
if err != nil {
return err
}
r, err := hcsshim.NewLayerReader(driverInfo, path, parentLayerPaths)
r, err := wclayer.NewLayerReader(ctx, path, parentLayerPaths)
if err != nil {
return err
}
@@ -52,7 +50,7 @@ func ExportLayerToTar(ctx context.Context, w io.Writer, path string, parentLayer
return cerr
}
func writeTarFromLayer(ctx context.Context, r hcsshim.LayerReader, w io.Writer) error {
func writeTarFromLayer(ctx context.Context, r wclayer.LayerReader, w io.Writer) error {
t := tar.NewWriter(w)
for {
select {

View File

@@ -1,3 +1,5 @@
//go:build windows
package ociwclayer
import (
@@ -12,7 +14,7 @@ import (
winio "github.com/Microsoft/go-winio"
"github.com/Microsoft/go-winio/backuptar"
"github.com/Microsoft/hcsshim"
"github.com/Microsoft/hcsshim/internal/wclayer"
)
const whiteoutPrefix = ".wh."
@@ -41,7 +43,7 @@ func ImportLayerFromTar(ctx context.Context, r io.Reader, path string, parentLay
if err != nil {
return 0, err
}
w, err := hcsshim.NewLayerWriter(hcsshim.DriverInfo{}, path, parentLayerPaths)
w, err := wclayer.NewLayerWriter(ctx, path, parentLayerPaths)
if err != nil {
return 0, err
}
@@ -56,7 +58,7 @@ func ImportLayerFromTar(ctx context.Context, r io.Reader, path string, parentLay
return n, nil
}
func writeLayerFromTar(ctx context.Context, r io.Reader, w hcsshim.LayerWriter, root string) (int64, error) {
func writeLayerFromTar(ctx context.Context, r io.Reader, w wclayer.LayerWriter, root string) (int64, error) {
t := tar.NewReader(r)
hdr, err := t.Next()
totalSize := int64(0)