-
Notifications
You must be signed in to change notification settings - Fork 386
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
✨ Refactor Syncer based on the enhanced ddsif, with controller manager and endpoints controller #2452
✨ Refactor Syncer based on the enhanced ddsif, with controller manager and endpoints controller #2452
Conversation
Skipping CI for Draft Pull Request. |
3aac818
to
a548f62
Compare
a548f62
to
b649de6
Compare
/hold pending workspace refactor |
3048f4e
to
c2d8575
Compare
74b99ad
to
d7913f9
Compare
// known by this informer factory, and that are synced. | ||
// | ||
// If any informers aren't synced, their GVRs are returned so that they can be | ||
// checked and processed later. | ||
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Listers() (listers map[schema.GroupVersionResource]Lister, notSynced []schema.GroupVersionResource) { | ||
listers = map[schema.GroupVersionResource]Lister{} | ||
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Informers() (informers map[schema.GroupVersionResource]GenericInformer, notSynced []schema.GroupVersionResource) { |
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.
👍, much better
} | ||
|
||
// Create the controller | ||
|
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.
nit: no empty line
pkg/syncer/syncer.go
Outdated
go upstreamUpsyncerControllerManager.Start(ctx) | ||
|
||
downstreamSyncerControllerManager := controllermanager.NewControllerManager(ctx, | ||
"downstream", |
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.
nit: downstream-syncer to be consistent
@@ -134,9 +141,18 @@ func StartSyncer(ctx context.Context, cfg *SyncerConfig, numSyncerThreads int, i | |||
|
|||
upstreamConfig := rest.CopyConfig(cfg.UpstreamConfig) | |||
upstreamConfig.Host = syncerVirtualWorkspaceURL | |||
rest.AddUserAgent(upstreamConfig, "kcp#spec-syncer/"+kcpVersion) | |||
rest.AddUserAgent(upstreamConfig, "kcp#syncing/"+kcpVersion) |
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.
don't think that's a valid user agent.
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.
It seems that the way user agents are set in the Syncer should be reworked globally to bring back both inner consistency, and also consistency with other KCP components.
Dedicated issue created: https://github.com/kcp-dev/kcp/issues/2581
Signed-off-by: David Festal
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
... of a GVR-specific controller driven by the controller manager. Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
5aed415
to
a22427d
Compare
/test test |
/lgtm |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Failing DNS tests twice. Coincidence? |
Unfortunately I approved PR #2542 yesterday (GH tests were successful), but in fact it might be that it needed some rebase first. And now the related tests are failing. So it doesn't seem to be related to this PR, but I still have to check. |
Signed-off-by: David Festal <dfestal@redhat.com>
Well, in fact the test is perfect and worked exactly as expected. it was this PR having a bug. See commit 3de7ac8 Great and very useful e2e test @lionelvillard ! |
/lgtm |
Summary
PROOF PR of a refactoring of the Syncer to use common ddsif informer factories for all the Syncer + other controllers.
It also includes a controller manager, which allows starting / stopping GVR-specific controllers when new GVRs are supported in the list of Synced resources.
It is based on the work done on the ddsif in PR #2440
Related issue(s)
No related issue. But it is a pre-requisite to the merge of PRs like #2338