commit
21264a11ec
|
@ -0,0 +1 @@
|
|||
remove the schedule validation and instead of checking the schedule because we might be in another cluster we check if a backup exist with the schedule name.
|
|
@ -171,9 +171,13 @@ func (o *CreateOptions) Validate(c *cobra.Command, args []string, f client.Facto
|
|||
return err
|
||||
}
|
||||
case o.ScheduleName != "":
|
||||
if _, err := o.client.VeleroV1().Schedules(f.Namespace()).Get(o.ScheduleName, metav1.GetOptions{}); err != nil {
|
||||
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(backupItems.Items) == 0 {
|
||||
return errors.Errorf("No backups found for the schedule %s", o.ScheduleName)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue