Change subcommand restic to repo

Signed-off-by: allenxu404 <qix2@vmware.com>
This commit is contained in:
allenxu404
2022-10-13 19:45:52 +08:00
parent c0430b8964
commit 154f5551c6
5 changed files with 7 additions and 44 deletions

View File

@@ -0,0 +1 @@
Change subcommand `velero restic repo` to `velero repo`

View File

@@ -33,7 +33,7 @@ func NewGetCommand(f client.Factory, use string) *cobra.Command {
c := &cobra.Command{
Use: use,
Short: "Get restic repositories",
Short: "Get repositories",
Run: func(c *cobra.Command, args []string) {
err := output.ValidateFlags(c)
cmd.CheckError(err)

View File

@@ -22,11 +22,11 @@ import (
"github.com/vmware-tanzu/velero/pkg/client"
)
func NewRepositoryCommand(f client.Factory) *cobra.Command {
func NewCommand(f client.Factory) *cobra.Command {
c := &cobra.Command{
Use: "repo",
Short: "Work with restic repositories",
Long: "Work with restic repositories",
Short: "Work with repositories",
Long: "Work with repositories",
}
c.AddCommand(

View File

@@ -1,38 +0,0 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package restic
import (
"github.com/spf13/cobra"
"github.com/vmware-tanzu/velero/pkg/client"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/restic/repo"
)
func NewCommand(f client.Factory) *cobra.Command {
c := &cobra.Command{
Use: "restic",
Short: "Work with restic",
Long: "Work with restic",
}
c.AddCommand(
repo.NewRepositoryCommand(f),
)
return c
}

View File

@@ -39,7 +39,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/cmd/cli/get"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/install"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/plugin"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/restic"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/repo"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/restore"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/schedule"
"github.com/vmware-tanzu/velero/pkg/cmd/cli/snapshotlocation"
@@ -117,7 +117,7 @@ operations can also be performed as 'velero backup get' and 'velero schedule cre
delete.NewCommand(f),
cliclient.NewCommand(),
completion.NewCommand(),
restic.NewCommand(f),
repo.NewCommand(f),
bug.NewCommand(),
backuplocation.NewCommand(f),
snapshotlocation.NewCommand(f),