Add confirm flag to velero plugin add

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
Tiger Kaovilai
2024-03-26 05:56:11 +07:00
parent f1f7f04233
commit 3c243653c4
9 changed files with 80 additions and 39 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/client"
"github.com/vmware-tanzu/velero/pkg/cmd"
"github.com/vmware-tanzu/velero/pkg/cmd/cli"
"github.com/vmware-tanzu/velero/pkg/cmd/util/confirm"
)
// NewDeleteCommand creates and returns a new cobra command for deleting backup-locations.
@@ -67,7 +68,7 @@ func NewDeleteCommand(f client.Factory, use string) *cobra.Command {
// Run performs the delete backup-location operation.
func Run(f client.Factory, o *cli.DeleteOptions) error {
if !o.Confirm && !cli.GetConfirmation() {
if !o.Confirm && !confirm.GetConfirmation() {
// Don't do anything unless we get confirmation
return nil
}