Skip to content

Commit

Permalink
include restore & schedule under ark delete
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kriss <steve@heptio.com>
  • Loading branch information
skriss committed Dec 21, 2017
1 parent f512379 commit 8e5feec
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/cli-reference/ark_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

35 changes: 35 additions & 0 deletions docs/cli-reference/ark_delete_restore.md
Original file line number Diff line number Diff line change
@@ -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

35 changes: 35 additions & 0 deletions docs/cli-reference/ark_delete_schedule.md
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions pkg/cmd/cli/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cli/restore/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cli/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cli/schedule/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cli/schedule/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e5feec

Please sign in to comment.