mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-22 06:43:28 +00:00
Migrate to containerd 1.54
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
4c9c66812a
commit
2ae8b31ac0
25
vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
generated
vendored
25
vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
generated
vendored
@ -1,26 +1,21 @@
|
||||
package wclayer
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/hcserror"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/Microsoft/hcsshim/internal/oc"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
// LayerExists will return true if a layer with the given id exists and is known
|
||||
// to the system.
|
||||
func LayerExists(path string) (_ bool, err error) {
|
||||
func LayerExists(ctx context.Context, path string) (_ bool, err error) {
|
||||
title := "hcsshim::LayerExists"
|
||||
fields := logrus.Fields{
|
||||
"path": path,
|
||||
}
|
||||
logrus.WithFields(fields).Debug(title)
|
||||
defer func() {
|
||||
if err != nil {
|
||||
fields[logrus.ErrorKey] = err
|
||||
logrus.WithFields(fields).Error(err)
|
||||
} else {
|
||||
logrus.WithFields(fields).Debug(title + " - succeeded")
|
||||
}
|
||||
}()
|
||||
ctx, span := trace.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
||||
defer span.End()
|
||||
defer func() { oc.SetSpanStatus(span, err) }()
|
||||
span.AddAttributes(trace.StringAttribute("path", path))
|
||||
|
||||
// Call the procedure itself.
|
||||
var exists uint32
|
||||
@ -28,6 +23,6 @@ func LayerExists(path string) (_ bool, err error) {
|
||||
if err != nil {
|
||||
return false, hcserror.New(err, title+" - failed", "")
|
||||
}
|
||||
fields["layer-exists"] = exists != 0
|
||||
span.AddAttributes(trace.BoolAttribute("layer-exists", exists != 0))
|
||||
return exists != 0, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user