mirror of
https://github.com/containers/skopeo.git
synced 2025-09-08 10:09:50 +00:00
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.37.0 to 1.38.0. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.37.0...v1.38.0) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
27 lines
689 B
Go
27 lines
689 B
Go
package wclayer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/hcserror"
|
|
"github.com/Microsoft/hcsshim/internal/oc"
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// GrantVmAccess adds access to a file for a given VM
|
|
func GrantVmAccess(ctx context.Context, vmid string, filepath string) (err error) {
|
|
title := "hcsshim::GrantVmAccess"
|
|
ctx, span := trace.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
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 {
|
|
return hcserror.New(err, title, "")
|
|
}
|
|
return nil
|
|
}
|