Skip to content

Commit 07b39e7

Browse files
imkiraajithcnambiarWojtek Koronski
committed
fix: resource already exists
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 <ajith.chandran@woven.toyota> Co-authored-by: Wojtek Koronski <wojtek.koronski@woven.toyota>
1 parent 53e3b7d commit 07b39e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/controllers/syncer/translator/namespaced_translator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ func (n *namespacedTranslator) SyncToHostCreate(ctx *context.SyncContext, vObj,
8080
ctx.Log.Debugf("error syncing %s %s/%s to physical cluster: %v", n.name, vObj.GetNamespace(), vObj.GetName(), err)
8181
return ctrl.Result{RequeueAfter: time.Second}, nil
8282
}
83+
if kerrors.IsAlreadyExists(err) {
84+
ctx.Log.Debugf("ignoring syncing %s %s/%s to physical cluster as it already exists", n.name, vObj.GetNamespace(), vObj.GetName())
85+
return ctrl.Result{}, nil
86+
}
8387
ctx.Log.Infof("error syncing %s %s/%s to physical cluster: %v", n.name, vObj.GetNamespace(), vObj.GetName(), err)
8488
n.eventRecorder.Eventf(vObj, "Warning", "SyncError", "Error syncing to physical cluster: %v", err)
8589
return ctrl.Result{}, err

0 commit comments

Comments
 (0)