-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: resource already exists #1785
base: main
Are you sure you want to change the base?
fix: resource already exists #1785
Conversation
✅ Deploy Preview for vcluster-docs canceled.Built without sensitive environment variables
|
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]>
e1d7d3d
to
07b39e7
Compare
@heiko-braun there's also this one which I rebased. PTAL cheers. |
@@ -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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond a need to update this PR again with the new generics code, I'll have to give this some thought. It has essentially moved to here but placing it in such a central place means that any resource trying to create on sync that already exists could take over the original object and start making changes to it. It might be better to let it fail here as its already doing, or put checks on specific resources like the service accounts.
What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>
if possible)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.
Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vcluster would not sync due to already existing default service accounts
What else do we need to know?
This is part of a collaborative work at Woven by Toyota with my colleagues @ajithcnambiar and @tauxi