443fdaa86b
The soundness guarantees of the CSI specification leave a little to be desired in our ability to provide a 100% reliable automated solution for managing volumes. This changeset provides a new command to bridge this gap by providing the operator the ability to intervene. The command doesn't take an allocation ID so that the operator doesn't have to keep track of alloc IDs that may have been GC'd. Handle this case in the unpublish RPC by sending the client RPC for all the terminal/nil allocs on the selected node.
51 lines
901 B
Go
51 lines
901 B
Go
package command
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/mitchellh/cli"
|
|
)
|
|
|
|
type VolumeCommand struct {
|
|
Meta
|
|
}
|
|
|
|
func (c *VolumeCommand) Help() string {
|
|
helpText := `
|
|
Usage: nomad volume <subcommand> [options]
|
|
|
|
volume groups commands that interact with volumes.
|
|
|
|
Register a new volume or update an existing volume:
|
|
|
|
$ nomad volume register <input>
|
|
|
|
Examine the status of a volume:
|
|
|
|
$ nomad volume status <id>
|
|
|
|
Deregister an unused volume:
|
|
|
|
$ nomad volume deregister <id>
|
|
|
|
Detach an unused volume:
|
|
|
|
$ nomad volume detach <vol id> <node id>
|
|
|
|
Please see the individual subcommand help for detailed usage information.
|
|
`
|
|
return strings.TrimSpace(helpText)
|
|
}
|
|
|
|
func (c *VolumeCommand) Name() string {
|
|
return "volume"
|
|
}
|
|
|
|
func (c *VolumeCommand) Synopsis() string {
|
|
return "Interact with volumes"
|
|
}
|
|
|
|
func (c *VolumeCommand) Run(args []string) int {
|
|
return cli.RunResultHelp
|
|
}
|