-
Notifications
You must be signed in to change notification settings - Fork 7
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
[DPE-5711] Add warnings to destructive actions #336
Conversation
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.
Can you please explain the benefits of merging this? Warning for force action?
Can we warn it globally in a moment of setting force=True
?
Up 2 Paulo and Carl.
I think that the
We could put it in the charm's |
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.
My take on this is that, having the differentiation can be useful for a post morten check if things go bad and logs where not in debug level.
ff135b6
to
c65a75b
Compare
Added info messages to Workload._diable_router method. |
9888ce7
to
dd704dd
Compare
@@ -222,6 +222,7 @@ def determine_partition() -> int: | |||
action_event.fail(message) | |||
return | |||
if force: | |||
logger.warning(f"Resume upgrade action ran with {force=}") |
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.
logger.warning(f"Resume upgrade action ran with {force=}") | |
logger.warning(f"Resume upgrade action ran with force=True") |
nit (#336 (comment))
technically end result is the same, but think we should avoid using repr syntax (e.g. for type str) when the output is intended for the user instead of developer, since repr syntax does not line up with juju cli syntax
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 see many usages of this syntax throughout the repo (see GitHub search). Keeping it 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.
those usages are when the output is intended for developer, and to show the developer what the value of a python variable is
those usages are not for displaying what the user inputs of a juju action were
This PR adds warning level messages when a destructive action is performed. The definition of destructive seems to be associated with data loss, which I think it can only happen, from user action, whenever they force a primary failover without checking considering the health of such instance.
Additional info