* test: added missing tests for the CronJob analyzer
- Fixed a small bug where pre-analysis was incorrectly appended to the
results every time at the end of the for loop. This caused the result
for a single cronjob failure to be appended multiple times in the
final results.
- Added missing test cases to ensure proper testing of the CronJob
analyzer. The addition of these missing test cases has increased the
code coverage of this analyzer to over 96%.
Partially Addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
* test: removed failure strings matching from tests
It is possible that the error or failure strings might change in the
future, causing the tests to fail. This commit addresses that issue by
removing the matching of failure text from various analyzer tests.
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
---------
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
* feat: expose metrics path & init analyzer errors metrics
This commit add metrics path & the analyzer error metrics in the codebase. The changes have been made across all analyzers and include the addition of a new metric with label values for the analyzer's name, analyzed object's name, and namespace. The metric's value is set to the length of the analyzer objects failures.
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
* feat: add metric to cronjob & deployment & netpol
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
* feat: expose metric to NodeAnalyzer
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
---------
Signed-off-by: Matthis Holleville <matthish29@gmail.com>