-
Notifications
You must be signed in to change notification settings - Fork 261
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
✨ Conditions for OpenStackMachines #1288
✨ Conditions for OpenStackMachines #1288
Conversation
Skipping CI for Draft Pull Request. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Implementing conditions is a really huge improvement, tbh! I like it.
Some nits, but @mdbooth can certainly help better here 🙂
@tobiasgiese Implemented your suggestions and tried to make other messages consistent with them. General status update:
|
This PR is such a great addon for CAPO. Thanks a lot.
I think it is totally fine to add it to the recent version only. |
I rebased the PR against the current The PR is ready for review. |
/retest |
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
👍
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.
All in all this looks pretty solid 👌🏻
/approve
/hold cancel |
Tests will be fixed by #1313. I will rebase once that PR is merged. |
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.
I wonder if the severity of some conditions should be considered as Warning and not as Error. WDYT?
return ctrl.Result{}, nil | ||
case infrav1.InstanceStateDeleted: | ||
// we should avoid further actions for DELETED VM | ||
scope.Logger.Info("Instance state is DELETED, no actions") | ||
conditions.MarkFalse(openStackMachine, infrav1.InstanceReadyCondition, infrav1.InstanceDeletedReason, clusterv1.ConditionSeverityError, "") |
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.
This might be an expected state, so don't know if we should really considers this error severity.
Oh sorry, I guess the severity can be adapted as soon as the handleUpdateMachineError is removed in #1116. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apricote, seanschneeweiss, tobiasgiese 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 |
/lgtm |
IMO we should check wether it is required (machine == control-plane) before calling `loadbalancer.Service#ReconcileLoadBalancerMember`. The service should not be concerned with the type of machine it is called on. This also fixes one of the open bugs in PR kubernetes-sigs#1288.
What this PR does / why we need it:
Adds Conditions to the OpenStackMachineStatus.
See this example
clusterctl describe
output, that showcases the different conditions, and how they "bubble up" to theMachine
resources:So far there are two conditions:
InstanceReady
(related to the OpenStack Instance) andAPIServerIngressReadyCondition
(for ControlPlane machines -> LoadBalancer Member or Floating IP attachment)I set the severity based on:
handleUpdateMachineError
)handleUpdateMachineError
was called and the machine is no longer retried/reconciledThe
Ready
condition is set to the aggregate of thhe two custom conditions, and the CAPI Machine resource "bubbles up" to Ready message, so any errors can be observed easily, without having to inspect the OpenStackMachineWhich issue(s) this PR fixes:
Fixes #832
Replaces #972
Open Tasks:
Tests for OpenStackMachineControllerRequires proper envtest mocksAPIServerIngressReadyCondition
on non-control-plane machines when using api loadbalancer (see 🌱 only reconcile loadbalancer member if machine is control-plane #1294)Open Questions:
Should we add the conditions to all existing api versions (because its a backwards compatible change) or only to the most recent version (v1alpha6)?
/hold