Skip to content

Commit

Permalink
fix(recurring): fix update recurring job parameters does not work issue
Browse files Browse the repository at this point in the history
ref: longhorn/longhorn 8291

Signed-off-by: Jack Lin <jack.lin@suse.com>
  • Loading branch information
ChanYiLin authored and derekbit committed Jul 4, 2024
1 parent 76f01ff commit 15a769a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions manager/recurringjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,15 @@ func (m *VolumeManager) UpdateRecurringJob(spec longhorn.RecurringJobSpec) (*lon
}
sort.Strings(recurringJob.Spec.Groups)
sort.Strings(spec.Groups)
if recurringJob.Spec.Cron == spec.Cron &&
reflect.DeepEqual(recurringJob.Spec.Groups, spec.Groups) &&
recurringJob.Spec.Retain == spec.Retain &&
recurringJob.Spec.Concurrency == spec.Concurrency &&
reflect.DeepEqual(recurringJob.Spec.Labels, spec.Labels) {
if reflect.DeepEqual(recurringJob.Spec, spec) {
return recurringJob, nil
}
recurringJob.Spec.Cron = spec.Cron
recurringJob.Spec.Groups = spec.Groups
recurringJob.Spec.Retain = spec.Retain
recurringJob.Spec.Concurrency = spec.Concurrency
recurringJob.Spec.Labels = spec.Labels
recurringJob.Spec.Parameters = spec.Parameters
return m.ds.UpdateRecurringJob(recurringJob)
}

Expand Down

0 comments on commit 15a769a

Please sign in to comment.