-
Notifications
You must be signed in to change notification settings - Fork 431
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
Events patcher #1940
Events patcher #1940
Conversation
✅ Deploy Preview for vcluster-docs canceled.Built without sensitive environment variables
|
2f96dd7
to
d96f595
Compare
@@ -124,7 +111,9 @@ var _ syncer.ToVirtualSyncer = &eventSyncer{} | |||
|
|||
func (s *eventSyncer) SyncToVirtual(ctx *synccontext.SyncContext, pObj client.Object) (ctrl.Result, error) { | |||
// build the virtual event | |||
vObj, err := s.buildVirtualEvent(ctx.Context, pObj.(*corev1.Event)) | |||
vObj := pObj.DeepCopyObject().(*corev1.Event) | |||
vObj.ResourceVersion = "" |
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.
This should be translate.ResetObjectMetadata(vObj)
, but since this is called in translateEvent, is that even necessary at all?
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.
so if we don't call it manually beforehand, the resource version will still be set because vObj contains the resource version of the physical object at that point.
https://github.com/loft-sh/vcluster/pull/1940/files#diff-841ade67d794007be038e9be601ecb81f2e9b7b2e5b10ec260d13345b54294c1R43 this is where we would be overwriting it. To avoid doing that we should have a parameter to know whether we are creating the object or not. I believe it's slightly worse than the current solution
15ea55d
to
07d7275
Compare
What issue type does this pull request address? (keep at least one, remove the others)
/kind enhancement
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>
if possible)part of eng-4141
Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vcluster ...
What else do we need to know?