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

[WIP]: Started using tracker to ensure typemeta is set #7093

Closed
wants to merge 1 commit into from

Conversation

Cali0707
Copy link
Member

Fixes #7091

Proposed Changes

  • Use a tracker and the EnsureTypeMeta to ensure that the type meta is properly set

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

@knative-prow
Copy link

knative-prow bot commented Jul 14, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 14, 2023
@knative-prow
Copy link

knative-prow bot commented Jul 14, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Cali0707
Once this PR has been reviewed and has the lgtm label, please assign dsimansk for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 14, 2023
@knative-prow knative-prow bot requested review from creydr and matzew July 14, 2023 13:47
@Cali0707
Copy link
Member Author

@pierDipi I tried to follow your comment here but it does not seem to be working - any ideas what I am missing?

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: +0.03% 🎉

Comparison is base (4541f4f) 78.29% compared to head (13a904e) 78.32%.
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7093      +/-   ##
==========================================
+ Coverage   78.29%   78.32%   +0.03%     
==========================================
  Files         250      250              
  Lines       13290    13311      +21     
==========================================
+ Hits        10405    10426      +21     
  Misses       2353     2353              
  Partials      532      532              
Files Changed Coverage Δ
...iler/inmemorychannel/dispatcher/inmemorychannel.go 71.77% <72.72%> (+0.06%) ⬆️
...econciler/inmemorychannel/dispatcher/controller.go 85.00% <88.88%> (+4.09%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +143 to +148
inmemorychannelInformer.Informer().AddEventHandler(controller.HandleAll(
controller.EnsureTypeMeta(
r.tracker.OnChanged,
messagingv1.SchemeGroupVersion.WithKind("InMemoryChannel"),
),
))
Copy link
Member

@pierDipi pierDipi Jul 17, 2023

Choose a reason for hiding this comment

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

Sorry for the vague comment, it's not the tracker the solution but EnsureTypeMeta therefore where we set the handler (just above, it eventually calls ReconcileKind) we need to call EnsureTypeMeta

	gvk := messagingv1.SchemeGroupVersion.WithKind("InMemoryChannel")

	// ...

				AddFunc:    controller.EnsureTypeMeta(impl.Enqueue, gvk)
				UpdateFunc: controller.PassNew(controller.EnsureTypeMeta(impl.Enqueue, gvk)),
				DeleteFunc: controller.EnsureTypeMeta(r.deleteFunc, gvk),

that ensures that whatever object is passed to callback has the Typemeta based on gvk

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay thanks that makes sense!

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2023
@knative-prow-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Cali0707
Copy link
Member Author

Closing following discussion on #7091 re: fixing this in pkg

@Cali0707 Cali0707 closed this Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeMeta not properly set on IMC
3 participants