diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-14 05:17:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 05:17:38 -0700 |
commit | f2f0de430d7545d19ef9505d7f6d8ef46a0d36b9 (patch) | |
tree | 0e5a15f979b88eb2e05adb7ac0967dbfcaa7a459 /vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go | |
parent | 150679d7b10ad56b7f41d22810eb2c421edf9da5 (diff) | |
parent | 1f0cc866d4707c75116d210dc781534c9d7f62fd (diff) | |
download | podman-f2f0de430d7545d19ef9505d7f6d8ef46a0d36b9.tar.gz podman-f2f0de430d7545d19ef9505d7f6d8ef46a0d36b9.tar.bz2 podman-f2f0de430d7545d19ef9505d7f6d8ef46a0d36b9.zip |
Merge pull request #6204 from containers/dependabot/go_modules/github.com/containers/storage-1.19.2
Bump github.com/containers/storage from 1.19.1 to 1.19.2
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go')
-rw-r--r-- | vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go index 05735df6c..aa7c8ae1f 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go @@ -1,26 +1,22 @@ package wclayer import ( + "context" + "github.com/Microsoft/hcsshim/internal/hcserror" - "github.com/sirupsen/logrus" + "github.com/Microsoft/hcsshim/internal/oc" + "go.opencensus.io/trace" ) // GrantVmAccess adds access to a file for a given VM -func GrantVmAccess(vmid string, filepath string) (err error) { +func GrantVmAccess(ctx context.Context, vmid string, filepath string) (err error) { title := "hcsshim::GrantVmAccess" - fields := logrus.Fields{ - "vm-id": vmid, - "path": filepath, - } - 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) + defer span.End() + defer func() { oc.SetSpanStatus(span, err) }() + span.AddAttributes( + trace.StringAttribute("vm-id", vmid), + trace.StringAttribute("path", filepath)) err = grantVmAccess(vmid, filepath) if err != nil { |