...

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

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

     1  //go:build windows
     2  
     3  package wclayer
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/Microsoft/hcsshim/internal/hcserror"
     9  	"github.com/Microsoft/hcsshim/internal/interop"
    10  	"github.com/Microsoft/hcsshim/internal/oc"
    11  	"go.opencensus.io/trace"
    12  )
    13  
    14  // GetSharedBaseImages will enumerate the images stored in the common central
    15  // image store and return descriptive info about those images for the purpose
    16  // of registering them with the graphdriver, graph, and tagstore.
    17  func GetSharedBaseImages(ctx context.Context) (_ string, err error) {
    18  	title := "hcsshim::GetSharedBaseImages"
    19  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    20  	defer span.End()
    21  	defer func() { oc.SetSpanStatus(span, err) }()
    22  
    23  	var buffer *uint16
    24  	err = getBaseImages(&buffer)
    25  	if err != nil {
    26  		return "", hcserror.New(err, title, "")
    27  	}
    28  	imageData := interop.ConvertAndFreeCoTaskMemString(buffer)
    29  	span.AddAttributes(trace.StringAttribute("imageData", imageData))
    30  	return imageData, nil
    31  }
    32  

View as plain text