-
Notifications
You must be signed in to change notification settings - Fork 205
fix: add kubeadmRbac to soot triggers slice #1169
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -361,7 +361,7 @@ func (m *Manager) Reconcile(ctx context.Context, request reconcile.Request) (res | |
| Client: m.AdminClient, | ||
| Phase: resources.PhaseClusterAdminRBAC, | ||
| }, | ||
| TriggerChannel: make(chan event.GenericEvent), | ||
| TriggerChannel: make(chan event.GenericEvent, 1), // buffered: pre-seeded below to run on startup | ||
| ControllerName: fmt.Sprintf("%s-kubeadmrbac", controllerNamePrefix), | ||
| } | ||
| if err = kubeadmRbac.SetupWithManager(mgr); err != nil { | ||
|
|
@@ -393,6 +393,12 @@ func (m *Manager) Reconcile(ctx context.Context, request reconcile.Request) (res | |
| close(completedCh) | ||
| }() | ||
|
|
||
| // Pre-seed so PhaseClusterAdminRBAC runs on startup rather than waiting for a kubeadm: CRB watch event. | ||
| var initTCP kamajiv1alpha1.TenantControlPlane | ||
| initTCP.Name = tcp.Name | ||
| initTCP.Namespace = tcp.Namespace | ||
| kubeadmRbac.TriggerChannel <- event.GenericEvent{Object: &initTCP} | ||
|
Comment on lines
+396
to
+400
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get the point of running this by triggering it, except to add an exception considering the eventually consistent nature of Kubernetes. When the Manager is configured, it will start the |
||
|
|
||
| m.sootMap[request.NamespacedName.String()] = sootItem{ | ||
| triggers: []chan event.GenericEvent{ | ||
| writePermissions.TriggerChannel, | ||
|
|
@@ -403,6 +409,7 @@ func (m *Manager) Reconcile(ctx context.Context, request reconcile.Request) (res | |
| uploadKubeadmConfig.TriggerChannel, | ||
| uploadKubeletConfig.TriggerChannel, | ||
| bootstrapToken.TriggerChannel, | ||
| kubeadmRbac.TriggerChannel, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is absolutely a bug, and this is required. |
||
| }, | ||
| cancelFn: tcpCancelFn, | ||
| completedCh: completedCh, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
We don't need to change the channel's buffering: what's the rationale?
I get the point of the initial seeding, but I think this is not required.