Skip to content

Commit

Permalink
Code clean for backup cmd client.
Browse files Browse the repository at this point in the history
Signed-off-by: yanggang <[email protected]>
  • Loading branch information
yanggang committed Sep 21, 2023
1 parent d3e5bb7 commit b272542
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/cmd/cli/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ func (o *CreateOptions) Validate(c *cobra.Command, args []string, f client.Facto
return err
}

client, err := f.KubebuilderWatchClient()
if err != nil {
return err
}

// Ensure that unless FromSchedule is set, args contains a backup name
if o.FromSchedule == "" && len(args) != 1 {
return fmt.Errorf("a backup name is required, unless you are creating based on a schedule")
Expand All @@ -191,7 +186,7 @@ func (o *CreateOptions) Validate(c *cobra.Command, args []string, f client.Facto

if o.StorageLocation != "" {
location := &velerov1api.BackupStorageLocation{}
if err := client.Get(context.Background(), kbclient.ObjectKey{
if err := o.client.Get(context.TODO(), kbclient.ObjectKey{
Namespace: f.Namespace(),
Name: o.StorageLocation,
}, location); err != nil {
Expand Down

0 comments on commit b272542

Please sign in to comment.