Skip to content

feat: add ability to force sync an event into default namespace #2786

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matskiv
Copy link
Contributor

@matskiv matskiv commented May 13, 2025

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)
resolves ENG-6860

Please provide a short message that should be published in the vcluster release notes
Added ability to force sync Events that don't have an involvedObject that is synced from vCluster. These events will be synced into the default namespace.

What else do we need to know?

@matskiv matskiv requested a review from a team as a code owner May 13, 2025 20:05
@@ -49,6 +50,11 @@ func (s *eventMapper) HostToVirtual(ctx *synccontext.SyncContext, req types.Name
err = IgnoreAcceptableErrors(err)
if err != nil {
klog.Infof("Error retrieving involved object for %s/%s: %v", req.Namespace, req.Name, err)
} else if pObj.GetAnnotations()[constants.SyncResourceAnnotation] == "true" {
return types.NamespacedName{
Namespace: "default",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move this into a variable or a constant?

Just a question, why are we hardcoding it to the default ns?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move this into a variable or a constant?

Ok, will do.

Just a question, why are we hardcoding it to the default ns?

If the event is not related to any specific synced resource then we don't have anything to go by to make the ns decision. Thus "default" seemed like a reasonable fallback. I've also considered adding an annotation for the virtual namespace, but default is enough for the initial use case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense.

@cbron cbron requested a review from hidalgopl May 20, 2025 18:47
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