fix(scenarios): fix cerberus call signature, missing imports, prometh…#1208
fix(scenarios): fix cerberus call signature, missing imports, prometh…#1208NETIZEN-11 wants to merge 8 commits intokrkn-chaos:mainfrom
Conversation
Review Summary by QodoFix runtime bugs across cerberus, prometheus, utils, and scenario plugins
WalkthroughsDescription• Fixed cerberus function call signature by removing extra cerberus_url argument • Added missing return statement in prometheus critical_alerts() function • Fixed HealthChecker boolean checks and added missing return value • Corrected variable reference in network_chaos_ng from config to scenario_config • Added missing base64 and json imports in zone_outage plugin • Improved variable naming clarity in prometheus metrics iteration loops Diagramflowchart LR
A["Runtime Bugs Identified"] --> B["Cerberus Setup"]
A --> C["Prometheus Client"]
A --> D["HealthChecker Utils"]
A --> E["Network Chaos NG"]
A --> F["Zone Outage Plugin"]
B --> B1["Fixed function signature"]
C --> C1["Added return statement"]
D --> D1["Fixed bool checks & return"]
E --> E1["Fixed variable reference"]
F --> F1["Added missing imports"]
B1 --> G["All modules execute without errors"]
C1 --> G
D1 --> G
E1 --> G
F1 --> G
File Changes1. krkn/cerberus/setup.py
|
Code Review by Qodo
1. Cerberus key breaks tests
|
…eus return, HealthChecker bool flags, network_chaos_ng len check Signed-off-by: Nitesh <nitesh@example.com>
…d fix test Signed-off-by: Nitesh <nitesh@example.com>
6c7b4ce to
5571b43
Compare
krkn/scenario_plugins/network_chaos_ng/network_chaos_ng_scenario_plugin.py
Outdated
Show resolved
Hide resolved
Per paigerube14 review on PR krkn-chaos#1208, move these changes to separate PRs for easier merge/test: - client.py: revert pod_type/pod_list variable rename back to k,v - network_chaos_ng_scenario_plugin.py: revert instance_count condition order - HealthChecker.py: revert current_iterations/ret_value back to class-level attrs
Per paigerube14 review on PR krkn-chaos#1208, move these changes to separate PRs for easier merge/test: - client.py: revert pod_type/pod_list variable rename back to k,v - network_chaos_ng_scenario_plugin.py: revert instance_count condition order - HealthChecker.py: revert current_iterations/ret_value back to class-level attrs Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com>
c343bcb to
046d037
Compare
What does this PR do?
Fixes multiple runtime bugs across cerberus, prometheus, utils, and scenario plugins.
Type of change
Description
This PR resolves several runtime issues across different components of the project,
including cerberus, prometheus, utils, and scenario plugins.
Fixes included:
cerberus/setup.py
application_status()cerberus_urlto match expected signatureprometheus/client.py
critical_alerts()return firing_alertsto ensure correct outpututils/HealthChecker.py
== Truewith proper identity checkis Truereturn self.ret_valueto prevent unintendedNonereturnscenario_plugins/network_chaos_ng
len(config)len(scenario_config)for correct scenario handlingscenario_plugins/zone_outage
base64andjsonNameErrorduring execution innode_based_zone()These fixes prevent runtime errors such as
TypeError,NameError, and unintendedNonereturns,ensuring more stable execution across modules.
Related Tickets & Documents
Documentation
Related Documentation PR (if applicable)
N/A
Checklist before requesting a review
Ensure the changes and proposed solution have been discussed in the relevant issue and have received acknowledgment from the community or maintainers.
I have performed a self-review of my code by running krkn and specific scenarios
If it is a core feature, I have added thorough unit tests with above 80% coverage
REQUIRED:
Description of combination of tests performed and output of run
Tested individual modules after fixes: