...
1
2
3 package wclayer
4
5 import (
6 "context"
7
8 "github.com/Microsoft/hcsshim/internal/hcserror"
9 "github.com/Microsoft/hcsshim/internal/oc"
10 "go.opencensus.io/trace"
11 )
12
13
14
15 func CreateLayer(ctx context.Context, path, parent string) (err error) {
16 title := "hcsshim::CreateLayer"
17 ctx, span := oc.StartSpan(ctx, title)
18 defer span.End()
19 defer func() { oc.SetSpanStatus(span, err) }()
20 span.AddAttributes(
21 trace.StringAttribute("path", path),
22 trace.StringAttribute("parent", parent))
23
24 err = createLayer(&stdDriverInfo, path, parent)
25 if err != nil {
26 return hcserror.New(err, title, "")
27 }
28 return nil
29 }
30
View as plain text