mirror of
https://github.com/rancher/plugins.git
synced 2025-09-01 10:32:22 +00:00
Windows: Updates Windows Vendoring
Updates windows dependent libraries for vendoing.
This commit is contained in:
33
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go
generated
vendored
Normal file
33
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
package runhcs
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// DeleteOpts is set of options that can be used with the Delete command.
|
||||
type DeleteOpts struct {
|
||||
// Force forcibly deletes the container if it is still running (uses SIGKILL).
|
||||
Force bool
|
||||
}
|
||||
|
||||
func (opt *DeleteOpts) args() ([]string, error) {
|
||||
var out []string
|
||||
if opt.Force {
|
||||
out = append(out, "--force")
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Delete any resources held by the container often used with detached
|
||||
// containers.
|
||||
func (r *Runhcs) Delete(context context.Context, id string, opts *DeleteOpts) error {
|
||||
args := []string{"delete"}
|
||||
if opts != nil {
|
||||
oargs, err := opts.args()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
args = append(args, oargs...)
|
||||
}
|
||||
return r.runOrError(r.command(context, append(args, id)...))
|
||||
}
|
Reference in New Issue
Block a user