Windows: Updates Windows Vendoring
Updates windows dependent libraries for vendoing.
This commit is contained in:
31
vendor/github.com/Microsoft/hcsshim/cmd/wclayer/remove.go
generated
vendored
Normal file
31
vendor/github.com/Microsoft/hcsshim/cmd/wclayer/remove.go
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
winio "github.com/Microsoft/go-winio"
|
||||
"github.com/Microsoft/hcsshim"
|
||||
"github.com/Microsoft/hcsshim/internal/appargs"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var removeCommand = cli.Command{
|
||||
Name: "remove",
|
||||
Usage: "permanently removes a layer directory in its entirety",
|
||||
ArgsUsage: "<layer path>",
|
||||
Before: appargs.Validate(appargs.NonEmptyString),
|
||||
Action: func(context *cli.Context) (err error) {
|
||||
path, err := filepath.Abs(context.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = winio.EnableProcessPrivileges([]string{winio.SeBackupPrivilege, winio.SeRestorePrivilege})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return hcsshim.DestroyLayer(driverInfo, path)
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user