...
1
2
3 package wclayer
4
5 import (
6 "context"
7 "os"
8
9 "github.com/Microsoft/hcsshim/internal/oc"
10 "go.opencensus.io/trace"
11 )
12
13
14
15 func ProcessBaseLayer(ctx context.Context, path string) (err error) {
16 title := "hcsshim::ProcessBaseLayer"
17 ctx, span := oc.StartSpan(ctx, title)
18 defer span.End()
19 defer func() { oc.SetSpanStatus(span, err) }()
20 span.AddAttributes(trace.StringAttribute("path", path))
21
22 err = processBaseImage(path)
23 if err != nil {
24 return &os.PathError{Op: title, Path: path, Err: err}
25 }
26 return nil
27 }
28
29
30
31 func ProcessUtilityVMImage(ctx context.Context, path string) (err error) {
32 title := "hcsshim::ProcessUtilityVMImage"
33 ctx, span := oc.StartSpan(ctx, title)
34 defer span.End()
35 defer func() { oc.SetSpanStatus(span, err) }()
36 span.AddAttributes(trace.StringAttribute("path", path))
37
38 err = processUtilityImage(path)
39 if err != nil {
40 return &os.PathError{Op: title, Path: path, Err: err}
41 }
42 return nil
43 }
44
View as plain text