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

Watch for node label change event in NicClusterPolicy reconcile loop #419

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

e0ne
Copy link
Collaborator

@e0ne e0ne commented Oct 22, 2022

We need to watch for node create event for correct cluster scale up by adding 'network.nvidia.com/operator.mofed.wait' label.

Signed-off-by: Ivan Kolodiazhny ikolodiazhny@nvidia.com

@e0ne e0ne marked this pull request as draft October 22, 2022 20:42
}

createEnqueue := handler.Funcs{
CreateFunc: func(e event.CreateEvent, q workqueue.RateLimitingInterface) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This won't work. We need to add label after NFD applied feature.node.kubernetes.io/pci-15b3.present label

Copy link
Collaborator

Choose a reason for hiding this comment

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

so it means you need to watch on just updates or create & update IMO

IsController: true,
OwnerType: &mellanoxv1alpha1.NicClusterPolicy{},
})
}).Watches(&source.Kind{Type: &corev1.Node{}}, createEnqueue, nodePredicates)
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think you would want to add this (watching on nodes) only once ?

}

createEnqueue := handler.Funcs{
CreateFunc: func(e event.CreateEvent, q workqueue.RateLimitingInterface) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

so it means you need to watch on just updates or create & update IMO

@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from bf94fa9 to 7cf4323 Compare October 24, 2022 08:19
@e0ne e0ne marked this pull request as ready for review October 24, 2022 08:20
@e0ne e0ne changed the title Watch for node create event in NicClusterPolicy reconcile loop Watch for node label change event in NicClusterPolicy reconcile loop Oct 24, 2022
@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from 7cf4323 to 6fc9863 Compare October 26, 2022 02:11
@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from 6fc9863 to 94b2c34 Compare October 26, 2022 11:30
@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from 94b2c34 to ea55907 Compare October 26, 2022 11:58
controllers/predicate.go Outdated Show resolved Hide resolved
controllers/nicclusterpolicy_controller.go Outdated Show resolved Hide resolved
@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from ea55907 to a7f0a63 Compare October 26, 2022 13:09
We need to watch for node create event for correct cluster scale up
by adding 'network.nvidia.com/operator.mofed.wait' label.

Signed-off-by: Ivan Kolodiazhny <ikolodiazhny@nvidia.com>
@e0ne e0ne force-pushed the nic-cluster-policy-node-reconcile branch from a7f0a63 to 29efa09 Compare October 26, 2022 14:06
@e0ne e0ne merged commit d829c76 into Mellanox:master Oct 28, 2022
@e0ne e0ne mentioned this pull request Nov 2, 2022
25 tasks
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.

3 participants