Skip to content

Commit

Permalink
EVEREST-1063 Schedules validation (#337)
Browse files Browse the repository at this point in the history
consider only the schedule regardless of the storage
  • Loading branch information
oksana-grishchenko authored May 28, 2024
1 parent 497a382 commit 1432ab5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ type apiSchedule []struct {
func checkDuplicateSchedules(schedules apiSchedule) error {
m := make(map[string]struct{})
for _, s := range schedules {
key := s.Schedule + s.BackupStorageName
key := s.Schedule
if _, ok := m[key]; ok {
return errDuplicatedSchedules
}
Expand Down
2 changes: 1 addition & 1 deletion api/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func TestValidateBackupSpec(t *testing.T) {
},
{
name: "errDuplicatedSchedules",
cluster: []byte(`{"spec": {"backup": {"enabled": true, "schedules": [{"schedule": "0 0 * * *", "name": "name"}, {"schedule": "0 0 * * *", "name": "name"}]}}}`),
cluster: []byte(`{"spec": {"backup": {"enabled": true, "schedules": [{"schedule": "0 0 * * *", "name": "name"}, {"schedule": "0 0 * * *", "name": "otherName"}]}}}`),
err: errDuplicatedSchedules,
},
{
Expand Down

0 comments on commit 1432ab5

Please sign in to comment.