mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 21:37:23 +00:00
full diff: https://github.com/microsoft/hcsshim/compare/v0.15.0-rc.3...v0.15.0-rc.4 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
30 lines
762 B
Go
30 lines
762 B
Go
//go:build windows
|
|
|
|
package wclayer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/hcserror"
|
|
"github.com/Microsoft/hcsshim/internal/ot"
|
|
"go.opentelemetry.io/otel/attribute"
|
|
)
|
|
|
|
// CreateLayer creates a new, empty, read-only layer on the filesystem based on
|
|
// the parent layer provided.
|
|
func CreateLayer(ctx context.Context, path, parent string) (err error) {
|
|
title := "hcsshim::CreateLayer"
|
|
ctx, span := ot.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
defer span.End()
|
|
defer func() { ot.SetSpanStatus(span, err) }()
|
|
span.SetAttributes(
|
|
attribute.String("path", path),
|
|
attribute.String("parent", parent))
|
|
|
|
err = createLayer(&stdDriverInfo, path, parent)
|
|
if err != nil {
|
|
return hcserror.New(err, title, "")
|
|
}
|
|
return nil
|
|
}
|