-
Notifications
You must be signed in to change notification settings - Fork 20
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
Create and delete machines via controller #36
Conversation
@luthermonson @zliang-akamai I'm a bit afraid of re-queuing every instance we wait for, maybe it makes sense to retry only X times and dropping the event instead of filling workqueue and waste reconciliation threads WDYT?:
|
want to extend the back off as it gets older? if these dont end up running we could be in a way worse case for the data center so eventually stopping at 10 or 15min might be plent? |
34269b2
to
262324d
Compare
262324d
to
1a572a1
Compare
@luthermonson It is ready to merge. I couldn't test the change, because of the missing other parts of the project, but verified the behavior based on other well known provider. |
1a572a1
to
2058ce0
Compare
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.
LGTM as is. Comments are nits/prompts for futher discussion we can have after merge if that's desirable.
return ctrl.Result{}, nil | ||
default: | ||
match := false |
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.
What do you think about using the slices package for this?
if !slices.ContainsFunc(linodeMachine.OwnerReferences, func(or metav1.OwnerReference) bool {
return or.UID == machine.UID
}) {
log.Info("Failed to find the referenced owner machine, skipping reconciliation", "references", linodeMachine.OwnerReferences, "machine", machine.ObjectMeta)
}
return ctrl.Result{}, nil
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.
@avestuk in my personal opinion is slices
package breaks one of the principles of Golang: simplicity. I would be the last who suggest adopting it :D But of course the question is what we think about his teamwise.
} | ||
}() | ||
|
||
// Delete |
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.
What do you think about breaking the delete/update/create parts of this function out into their own functions? I don't mind if we do it later in another PR (I'm happy to take a crack at it for instance) but I think the function would be more easily understood if we did so.
Co-authored-by: Alex Vest <[email protected]>
* Create and delete machines via controller * Update cloud/scope/cluster.go Co-authored-by: Alex Vest <[email protected]> --------- Co-authored-by: Richard Kovacs <[email protected]> Co-authored-by: Alex Vest <[email protected]>
I open this PR for transparency. I'm still testing, but i think it is ready to discuss :).
This change doing reconciliation loop for Linode Machines. Only create and delete has been implemented. You can find some buxfixes and code cleanups too, i tried to push the scope as low as possible.
Fixes: #25
Fixes: #11