forked from barak/tarpoon
Add glide.yaml and vendor deps
This commit is contained in:
parent
db918f12ad
commit
5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions
92
vendor/github.com/opencontainers/runc/pause.go
generated
vendored
Normal file
92
vendor/github.com/opencontainers/runc/pause.go
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var pauseCommand = cli.Command{
|
||||
Name: "pause",
|
||||
Usage: "pause suspends all processes inside the container",
|
||||
ArgsUsage: `<container-id> [container-id...]
|
||||
|
||||
Where "<container-id>" is the name for the instance of the container to be
|
||||
paused. `,
|
||||
Description: `The pause command suspends all processes in the instance of the container.
|
||||
|
||||
Use runc list to identiy instances of containers and their current status.`,
|
||||
Action: func(context *cli.Context) error {
|
||||
hasError := false
|
||||
if !context.Args().Present() {
|
||||
return fmt.Errorf("runc: \"pause\" requires a minimum of 1 argument")
|
||||
}
|
||||
|
||||
factory, err := loadFactory(context)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, id := range context.Args() {
|
||||
container, err := factory.Load(id)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "container %s does not exist\n", id)
|
||||
hasError = true
|
||||
continue
|
||||
}
|
||||
if err := container.Pause(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "pause container %s : %s\n", id, err)
|
||||
hasError = true
|
||||
}
|
||||
}
|
||||
|
||||
if hasError {
|
||||
return fmt.Errorf("one or more of container pause failed")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var resumeCommand = cli.Command{
|
||||
Name: "resume",
|
||||
Usage: "resumes all processes that have been previously paused",
|
||||
ArgsUsage: `<container-id> [container-id...]
|
||||
|
||||
Where "<container-id>" is the name for the instance of the container to be
|
||||
resumed.`,
|
||||
Description: `The resume command resumes all processes in the instance of the container.
|
||||
|
||||
Use runc list to identiy instances of containers and their current status.`,
|
||||
Action: func(context *cli.Context) error {
|
||||
hasError := false
|
||||
if !context.Args().Present() {
|
||||
return fmt.Errorf("runc: \"resume\" requires a minimum of 1 argument")
|
||||
}
|
||||
|
||||
factory, err := loadFactory(context)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, id := range context.Args() {
|
||||
container, err := factory.Load(id)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "container %s does not exist\n", id)
|
||||
hasError = true
|
||||
continue
|
||||
}
|
||||
if err := container.Resume(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "resume container %s : %s\n", id, err)
|
||||
hasError = true
|
||||
}
|
||||
}
|
||||
|
||||
if hasError {
|
||||
return fmt.Errorf("one or more of container resume failed")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue