Skip to content

Commit

Permalink
Catch already exist create error on RS and RD
Browse files Browse the repository at this point in the history
  • Loading branch information
kaovilai committed Nov 7, 2022
1 parent 2e43d7a commit 2a71d7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controllers/replicationdestination.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func (r *VolumeSnapshotRestoreReconciler) CreateReplicationDestination(log logr.

return r.buildReplicationDestination(repDestination, &vsr, &resticSecret)
})
if err != nil {
if err != nil && !k8serrors.IsAlreadyExists(err){
// don't error out if create errors due to replicationDestination already exists
return false, err
}

Expand Down
3 changes: 2 additions & 1 deletion controllers/replicationsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func (r *VolumeSnapshotBackupReconciler) CreateReplicationSource(log logr.Logger

return r.buildReplicationSource(repSource, &vsb, &clonedPVC)
})
if err != nil {
if err != nil && !k8serrors.IsAlreadyExists(err){
// don't error out if create errors due to replicationSource already exists
return false, err
}

Expand Down

0 comments on commit 2a71d7d

Please sign in to comment.