include restore & schedule under ark delete

Signed-off-by: Steve Kriss <steve@heptio.com>
pull/252/head
Steve Kriss 2017-12-20 11:24:39 -08:00
parent f5123794e0
commit 8e5feec39c
8 changed files with 88 additions and 6 deletions

View File

@ -29,4 +29,6 @@ Delete ark resources
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark delete backup](ark_delete_backup.md) - Delete a backup
* [ark delete restore](ark_delete_restore.md) - Delete a restore
* [ark delete schedule](ark_delete_schedule.md) - Delete a schedule

View File

@ -0,0 +1,35 @@
## ark delete restore
Delete a restore
### Synopsis
Delete a restore
```
ark delete restore NAME [flags]
```
### Options
```
-h, --help help for restore
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark delete](ark_delete.md) - Delete ark resources

View File

@ -0,0 +1,35 @@
## ark delete schedule
Delete a schedule
### Synopsis
Delete a schedule
```
ark delete schedule NAME [flags]
```
### Options
```
-h, --help help for schedule
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark delete](ark_delete.md) - Delete ark resources

View File

@ -21,6 +21,8 @@ import (
"github.com/heptio/ark/pkg/client"
"github.com/heptio/ark/pkg/cmd/cli/backup"
"github.com/heptio/ark/pkg/cmd/cli/restore"
"github.com/heptio/ark/pkg/cmd/cli/schedule"
)
func NewCommand(f client.Factory) *cobra.Command {
@ -33,8 +35,16 @@ func NewCommand(f client.Factory) *cobra.Command {
backupCommand := backup.NewDeleteCommand(f, "backup")
backupCommand.Aliases = []string{"backups"}
restoreCommand := restore.NewDeleteCommand(f, "restore")
restoreCommand.Aliases = []string{"restores"}
scheduleCommand := schedule.NewDeleteCommand(f, "schedule")
scheduleCommand.Aliases = []string{"schedules"}
c.AddCommand(
backupCommand,
restoreCommand,
scheduleCommand,
)
return c

View File

@ -27,9 +27,9 @@ import (
"github.com/heptio/ark/pkg/cmd"
)
func NewDeleteCommand(f client.Factory) *cobra.Command {
func NewDeleteCommand(f client.Factory, use string) *cobra.Command {
c := &cobra.Command{
Use: "delete NAME",
Use: fmt.Sprintf("%s NAME", use),
Short: "Delete a restore",
Run: func(c *cobra.Command, args []string) {
if len(args) != 1 {

View File

@ -34,7 +34,7 @@ func NewCommand(f client.Factory) *cobra.Command {
NewGetCommand(f, "get"),
NewLogsCommand(f),
NewDescribeCommand(f, "describe"),
NewDeleteCommand(f),
NewDeleteCommand(f, "delete"),
)
return c

View File

@ -27,9 +27,9 @@ import (
"github.com/heptio/ark/pkg/cmd"
)
func NewDeleteCommand(f client.Factory) *cobra.Command {
func NewDeleteCommand(f client.Factory, use string) *cobra.Command {
c := &cobra.Command{
Use: "delete NAME",
Use: fmt.Sprintf("%s NAME", use),
Short: "Delete a schedule",
Run: func(c *cobra.Command, args []string) {
if len(args) != 1 {

View File

@ -33,7 +33,7 @@ func NewCommand(f client.Factory) *cobra.Command {
NewCreateCommand(f, "create"),
NewGetCommand(f, "get"),
NewDescribeCommand(f, "describe"),
NewDeleteCommand(f),
NewDeleteCommand(f, "delete"),
)
return c