mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
Update shared Go dependencies to the versions used by Moby and regenerate vendor. Leave go-archive and sys/userns unchanged. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
//go:build windows
|
|
|
|
package wclayer
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/ot"
|
|
"go.opentelemetry.io/otel/attribute"
|
|
)
|
|
|
|
// ProcessBaseLayer post-processes a base layer that has had its files extracted.
|
|
// The files should have been extracted to <path>\Files.
|
|
func ProcessBaseLayer(ctx context.Context, path string) (err error) {
|
|
title := "hcsshim::ProcessBaseLayer"
|
|
ctx, span := ot.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
defer span.End()
|
|
defer func() { ot.SetSpanStatus(span, err) }()
|
|
span.SetAttributes(attribute.String("path", path))
|
|
|
|
err = processBaseImage(path)
|
|
if err != nil {
|
|
return &os.PathError{Op: title, Path: path, Err: err}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted.
|
|
// The files should have been extracted to <path>\Files.
|
|
func ProcessUtilityVMImage(ctx context.Context, path string) (err error) {
|
|
title := "hcsshim::ProcessUtilityVMImage"
|
|
ctx, span := ot.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
defer span.End()
|
|
defer func() { ot.SetSpanStatus(span, err) }()
|
|
span.SetAttributes(attribute.String("path", path))
|
|
|
|
err = processUtilityImage(path)
|
|
if err != nil {
|
|
return &os.PathError{Op: title, Path: path, Err: err}
|
|
}
|
|
return nil
|
|
}
|