-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: Remove redfish credential validation in install event handler #192
fix: Remove redfish credential validation in install event handler #192
Conversation
Will fix unit tests after rebasing changes from #191 once it's 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.
Thanks for the workaround
5897906
to
ba9d413
Compare
ba9d413
to
47a403a
Compare
f1a869b
to
1df3586
Compare
1df3586
to
7351e70
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.
It doesn't seem to me that I will fix the issue.. Have you test if it can fix the issue ?
Since the validation of redfish config did not remove from install or upgrade event, there's still possibility that operator deploys the charm with incorrect credential and causing the exporter not being installed.
Good thing you brought this up. So I did test this initially and the hook didn't fail for the charm and no exceptions were raised. So I thought the code was good. But upon checking once more carefully, another issue comes up. With the latest change, even after I configure the redfish creds, the status doesn't change from ^ @Pjack |
e75cbaf
to
e9e45aa
Compare
This commit just cleans up the unit test names and docstrings since many of them were incorrect. |
e9e45aa
to
6432d07
Compare
I've also added an extra check in |
6432d07
to
39da143
Compare
39da143
to
fd7a71f
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.
The code and logic looks good to me .
I would like to confirm where should we validate this behavior?
- config or credential is invalid
- User change the configuration or provide correct credential.
- Verify if the charm will become active state again.
Maybe in hardware-indendent functional test?
It would probably be in the hardware dependent functional tests if the redfish creds are invalid and we want to test that after the correct config is provided, the charm is in active status. Currently we only have the test to check if we're able to query the redfish metrics. If you're talking about any hardware independent config (exporter log level, port etc.), we already have functional tests for the behavior you've mentioned. But we do need to make some changes to verify that the charm is active afterwards. Currently it just verifies if the config is correctly changed in the underlying file. It would be good to have another refactoring PR for the functional tests as well so we can follow through on these requirements. |
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'm a little bit lost with the PR title, description and the bug that points the fix.
The bug description says:
This is because the blocked status message for invalid redfish creds has been overwritten by the missing relation message while executing the
update status hook
.
I'm not seeing any changes in the update status hook
.
What are we fixing by removing the validation of the exporter configs on the install hook?
Sorry about the confusion. We made some findings over the course the PR due to which we had to change the originally intended fix. I've made some changes to the PR description that hopefully clarifies your doubts. If not, feel free to respond with any questions and I'll try my best to address them. |
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 looks good to me for addressing the root cause
Fixes #190
The
exporter.check_active
method being called in therestart_exporter
method (from the update status event handler) will fail in case the exporter installation has not been done. This installation process takes place as part of the install event handler.The error happens because the
check_installed
function inservice.py
(called as a decorator for the various exporter service helper methods) would returnFalse
when the exporter isn't installed. This would cause all the Exporter class' methods in service.py (restart, check_active, check_health etc.) to returnFalse
. The issue occurs when theon_update_status()
-->restart_exporter()
raises an exception whenexporter.check_active
consistently returnsFalse
.This PR removes the redfish credential validation step during the install event since it's likely to not have the right configuration during the installation. Moreover, this can leave the charm in an inconsistent state where the exporter is not properly installed, leading to an error during the execution of other lifecycle events.