Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Baseboardmanagement controller implementation #3
Baseboardmanagement controller implementation #3
Changes from 10 commits
5d261a8
f6c12ec
3d691bb
e4f533a
dfe231e
876d116
e7c77bb
f93e1ef
2b70431
4038d9e
a34127a
3e3eed1
43f7ed6
cc8b689
eb72725
65acac8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 is nice, do you also want to update the status for other error cases below?
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.
Sure, I was thinking on this. We could add condition types, like
PowerStatusFailed
PowerSetFailed
?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.
Are we sure we have conditions right? A condition is typically defining a particular condition about the current state or a record of having passed through a particular state at some point, for example
Connected
, as opposed to a piece of data. That doesn't mean we can't add supplementary data like the error message but the condition itself needs to make sense and I'm not sureConnectionError
does given it is describing data that could just live at the top level ofStatus
.I feel like the following makes more sense
In the case of
Connected
a status ofFalse
indicates a problem and an error message is likely available where asUnknown
indicates we haven't even attempted to connect.The above is more akin to traditional usage of conditions that feature in the core API types like Pod lifecycle conditions.
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.
With respect to communicating a power status action failed that's really an event. We've tried to reconcile status by retrieving the current power state (or setting it) and it was unsuccessful so we generate an event for an operator to inspect. Events show up in the
kubectl describe
output.I mention that because we shouldn't get carried away with conditions. Conditions are meant to be useful for machines, events should be useful for humans.
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.
@pokearu Wants to address the conditions discussion in a separate PR so resolving for now.
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 think you still want to update the status on failure. You want to converge on desired state, not make it all-or-nothing
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.
As discussed, I modified the reconciler to update status when reconciling fields 👍
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.
@chrisdoherty4 @jacobweinstock there is no idempotency/locking in the whole reconcile, do we want/need that?
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.
Nope. When you're only considering the object under reconciliation there's no races as the manager ensures you're the only reconciler reconciling that resource.
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.
There is, of course, the possibility that an object is patched by something else but I don't think we have those semantics here.