diff --git a/changelogs/unreleased/5446-allenxu404 b/changelogs/unreleased/5446-allenxu404 new file mode 100644 index 0000000000..6d7675deed --- /dev/null +++ b/changelogs/unreleased/5446-allenxu404 @@ -0,0 +1 @@ +Change subcommand `velero restic repo` to `velero repo` \ No newline at end of file diff --git a/pkg/cmd/cli/restic/repo/get.go b/pkg/cmd/cli/repo/get.go similarity index 98% rename from pkg/cmd/cli/restic/repo/get.go rename to pkg/cmd/cli/repo/get.go index 24692f3552..3a730c1038 100644 --- a/pkg/cmd/cli/restic/repo/get.go +++ b/pkg/cmd/cli/repo/get.go @@ -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) diff --git a/pkg/cmd/cli/restic/repo/repo.go b/pkg/cmd/cli/repo/repo.go similarity index 84% rename from pkg/cmd/cli/restic/repo/repo.go rename to pkg/cmd/cli/repo/repo.go index 2f754d8691..957dad7930 100644 --- a/pkg/cmd/cli/restic/repo/repo.go +++ b/pkg/cmd/cli/repo/repo.go @@ -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( diff --git a/pkg/cmd/cli/restic/restic.go b/pkg/cmd/cli/restic/restic.go deleted file mode 100644 index 744cdbd5fa..0000000000 --- a/pkg/cmd/cli/restic/restic.go +++ /dev/null @@ -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 -} diff --git a/pkg/cmd/velero/velero.go b/pkg/cmd/velero/velero.go index 6338299c37..982761d2a9 100644 --- a/pkg/cmd/velero/velero.go +++ b/pkg/cmd/velero/velero.go @@ -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),