mirror of
https://github.com/containers/skopeo.git
synced 2025-09-06 01:00:43 +00:00
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.19.1 to 1.19.2. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.19.1...v1.19.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
23 lines
556 B
Go
23 lines
556 B
Go
package wclayer
|
|
|
|
import (
|
|
"context"
|
|
"path/filepath"
|
|
|
|
"github.com/Microsoft/go-winio/pkg/guid"
|
|
"github.com/Microsoft/hcsshim/internal/oc"
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// LayerID returns the layer ID of a layer on disk.
|
|
func LayerID(ctx context.Context, path string) (_ guid.GUID, err error) {
|
|
title := "hcsshim::LayerID"
|
|
ctx, span := trace.StartSpan(ctx, title)
|
|
defer span.End()
|
|
defer func() { oc.SetSpanStatus(span, err) }()
|
|
span.AddAttributes(trace.StringAttribute("path", path))
|
|
|
|
_, file := filepath.Split(path)
|
|
return NameToGuid(ctx, file)
|
|
}
|