update variable name

Signed-off-by: Carlos Panato <ctadeu@gmail.com>
This commit is contained in:
Carlos Panato
2020-01-31 09:22:46 +01:00
parent 4a5a63fc92
commit 42b6126458

View File

@@ -171,11 +171,11 @@ func (o *CreateOptions) Validate(c *cobra.Command, args []string, f client.Facto
return err
}
case o.ScheduleName != "":
scheduleItems, err := o.client.VeleroV1().Backups(f.Namespace()).List(metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", api.ScheduleNameLabel, o.ScheduleName)})
backupItems, err := o.client.VeleroV1().Backups(f.Namespace()).List(metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", api.ScheduleNameLabel, o.ScheduleName)})
if err != nil {
return err
}
if len(scheduleItems.Items) == 0 {
if len(backupItems.Items) == 0 {
return errors.Errorf("No backups found for the schedule %s", o.ScheduleName)
}
}