Skip to content

Commit

Permalink
fix: resource already exists
Browse files Browse the repository at this point in the history
During syncing of virtual namespaces to physical, the default service
account already exists, which leads to errors during syncing. In this
fix we consume the error in case the physical resource already exists.

Co-authored-by: Ajith Chandran <[email protected]>
Co-authored-by: Wojtek Koronski <[email protected]>
  • Loading branch information
3 people committed Jul 8, 2024
1 parent 53e3b7d commit 07b39e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controllers/syncer/translator/namespaced_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func (n *namespacedTranslator) SyncToHostCreate(ctx *context.SyncContext, vObj,
ctx.Log.Debugf("error syncing %s %s/%s to physical cluster: %v", n.name, vObj.GetNamespace(), vObj.GetName(), err)
return ctrl.Result{RequeueAfter: time.Second}, nil
}
if kerrors.IsAlreadyExists(err) {
ctx.Log.Debugf("ignoring syncing %s %s/%s to physical cluster as it already exists", n.name, vObj.GetNamespace(), vObj.GetName())
return ctrl.Result{}, nil
}
ctx.Log.Infof("error syncing %s %s/%s to physical cluster: %v", n.name, vObj.GetNamespace(), vObj.GetName(), err)
n.eventRecorder.Eventf(vObj, "Warning", "SyncError", "Error syncing to physical cluster: %v", err)
return ctrl.Result{}, err
Expand Down

0 comments on commit 07b39e7

Please sign in to comment.