-
Notifications
You must be signed in to change notification settings - Fork 213
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
ErrorStatusHandler - support for better error reporting in status #685
Conversation
* common that the custom resource is changed during an execution, and it's much cleaner to have | ||
* to original resource in place for status update. | ||
*/ | ||
private R cloneResourceIfErrorStatusHandlerIfCouldBeCalled(R resource, Context context) { |
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 method name doesn't make sense :)
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.
:D
will rename it :)
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.
done. :) not sure if much better
|
||
import io.fabric8.kubernetes.client.CustomResource; | ||
|
||
public interface ErrorStatusHandler<T extends CustomResource<?, ?>> { |
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.
Once we have the HasStatus
(or similar) interface, this probably should use that instead of CustomResource
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.
It will be moved to HasMetada if the other PR is merged.
…ava-operator-sdk into error-status-handler
* common that the custom resource is changed during an execution, and it's much cleaner to have | ||
* to original resource in place for status update. | ||
*/ | ||
private R cloneResourceIfErrorStatusHandlerIfNeeded(R resource, Context context) { |
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.
The more I think about it, the less I'm sure we need to clone before updating the status. Presumably, if the resource has changed, the reconciliation will happen again and this update should be cancelled, anyway?
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 mentioned in the docs, it is for the case when the reconciliation executed but at some point an exception thrown, meannwhile in the logic of reconcile
the status could be updated on the CR. I don't think we should use that, rather the original version of the resource. Since also info could be deleted, it's probably better to work with the fresh copy.
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.
Not convinced but I'll trust your judgement on this. :)
See linked issue.