Skip to content

Commit

Permalink
Adjust the exclusivity of the restore and archive job
Browse files Browse the repository at this point in the history
Restores aren't exclusive in upstream Restic:
https://github.com/restic/restic/blob/master/cmd/restic/cmd_restore.go#L
105

The exclusivity of the various job types should match what's defined in
the upstream Restic project.
  • Loading branch information
Simon Beck committed Dec 3, 2020
1 parent bde716c commit e504be6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions executor/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ func (a *ArchiveExecutor) Execute() error {
return nil
}

// Exclusive should return true for jobs that can't run while other jobs run.
func (*ArchiveExecutor) Exclusive() bool {
return true
}

func (a *ArchiveExecutor) startArchive(job *batchv1.Job, archive *k8upv1alpha1.Archive) {
name := types.NamespacedName{Namespace: a.Obj.GetMetaObject().GetNamespace(), Name: a.Obj.GetMetaObject().GetName()}
a.setArchiveCallback(name, archive)
Expand Down
5 changes: 0 additions & 5 deletions executor/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ func (r *RestoreExecutor) Execute() error {
return nil
}

// Exclusive should return true for jobs that can't run while other jobs run.
func (r *RestoreExecutor) Exclusive() bool {
return true
}

func (r *RestoreExecutor) startRestore(restore *k8upv1alpha1.Restore) {
name := types.NamespacedName{Namespace: r.Obj.GetMetaObject().GetNamespace(), Name: r.Obj.GetMetaObject().GetName()}
r.setRestoreCallback(name, restore)
Expand Down
2 changes: 1 addition & 1 deletion executor/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func jobMatcher(restoreType string, additionalArgs []string, env Elements, volum
"ObjectMeta": MatchFields(IgnoreExtras, Fields{
"Labels": MatchAllKeys(Keys{
"k8upjob": Equal("true"),
"k8upjob/exclusive": Equal("true"),
"k8upjob/exclusive": Equal("false"),
}),
}),
"Spec": MatchFields(IgnoreExtras, Fields{
Expand Down

0 comments on commit e504be6

Please sign in to comment.