...

Source file src/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go

Documentation: github.com/Microsoft/hcsshim/internal/wclayer

     1  //go:build windows
     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  // ProcessBaseLayer post-processes a base layer that has had its files extracted.
    14  // The files should have been extracted to <path>\Files.
    15  func ProcessBaseLayer(ctx context.Context, path string) (err error) {
    16  	title := "hcsshim::ProcessBaseLayer"
    17  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    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  // ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted.
    30  // The files should have been extracted to <path>\Files.
    31  func ProcessUtilityVMImage(ctx context.Context, path string) (err error) {
    32  	title := "hcsshim::ProcessUtilityVMImage"
    33  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    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