Skip to content
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

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Events patcher #1940

merged 2 commits into from
Jul 18, 2024

Conversation

facchettos
Copy link
Contributor

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?

Copy link

netlify bot commented Jul 16, 2024

Deploy Preview for vcluster-docs canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 1b71ed6
🔍 Latest deploy log https://app.netlify.com/sites/vcluster-docs/deploys/6698dd1cdf84ed00081adf6f

@@ -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 = ""
Copy link
Member

@FabianKramm FabianKramm Jul 17, 2024

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?

Copy link
Contributor Author

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

@FabianKramm FabianKramm merged commit 3523d87 into loft-sh:main Jul 18, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants