Signed-off-by: magicsong <songxuetao@bytedance.com>
Co-authored-by: magicsong <songxuetao@bytedance.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
* getting the error from status field for hpa analyzer
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Signed-off
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Updated the hpaAnalyzer_test.go
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Updated hpa_test.go
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Updated the hpa
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Updated the Conflicts
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Resolved all the conflicts
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
* Updated the test case
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
---------
Signed-off-by: naveenthangaraj03 <tnaveen3402@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Matthis <matthish29@gmail.com>
* chore: updated helmclient and helmv3
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: fixing tests
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* Added new tests for `LogAnalyzer` defined in the `pkg/analyzer`
package. Increased the code coverage of the `log.go` file to >90%
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
* Fix invalid ParentObj in output
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
* fix UT as well for ParentObj changes
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
* remove meta.Name in false output
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
* fix UT as well
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
---------
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
- Fixed a small bug where failures were being appended multiple times
for CrashLoopBackOff and ContainerCreating container status reasons.
- Added missing test cases to ensure proper testing of the Pod analyzer.
The addition of these missing test cases has increased the code
coverage of this analyzer to 98%.
- Added checks for init containers in a pod.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
* 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>
With the addition of the latest changes, the missing test case when an
event happens after the currently set latest event has been covered.
Partially Addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
- Added missing test cases to ensure proper testing of the Ingress
analyzer. The addition of these missing test cases has increased the
code coverage of this analyzer to over 97%.
Partially Addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
* Added new tests for the `Node` analyzer defined in the `pkg/analyzer`
package.
* The addition of these new tests has increased the code coverage of the
node.go file to over 96%.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
- Added a network policy allowing traffic to all pods. Resulting in
additional failures in the results.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
* Added new tests for the `Service` analyzer defined in the
`pkg/analyzer` package.
* The addition of these new tests has increased the code coverage of the
service.go file to over 97%.
* Additionally addressed some flaky tests related to the `ReplicaSet`and
`PersisentVolumeClaim` analyzers.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
- Removed test cases which required access to `/root` from the
`pkg/util` package.
- Fixed flaky `PodDisruptionBudget` test.
- Fixed a typo in `PersistentVolumeClaim` test.
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit introduces comprehensive tests for the
`PersistentVolumeClaim` analyzer defined in the `pkg/analyzer` package.
Adding these tests increases the code coverage of the `pvc.go` file to
>95%.
I also made minor modifications to the ReplicaSet test to ensure all
expectations were met.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit introduces comprehensive tests for the `PodDisruptionBudget`
analyzer defined in the `pkg/analyzer` package.
Adding these tests increases the code coverage of the `pdb.go` file to
>96%.
Additionally, a potential crash in case of empty or nil PDB status
conditions has been addressed.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit introduces comprehensive tests for the mutating webhook
analyzer defined in the `pkg/analyzer` package.
Adding these tests increases the code coverage of the
`mutating_webhook.go` file to almost 95%.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit introduces comprehensive tests for the ReplicaSet analyzer
defined in the `pkg/analyzer` package.
Adding these tests increases the code coverage of the `rs.go` file to
>95%.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit introduces comprehensive tests for the validating webhook
analyzer defined in the `pkg/analyzer` package.
Adding these tests increases the code coverage of the
`validating_webhook.go` file to almost 95%.
Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
* Log analyzer failed with multiple containers in the pod #884
Signed-off-by: lwan3 <lili_wan@intuit.com>
* Merge conflicts from main
Signed-off-by: lwan3 <lili_wan@intuit.com>
---------
Signed-off-by: lwan3 <lili_wan@intuit.com>
Co-authored-by: lwan3 <lili_wan@intuit.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
* chore: linting improvements and catching false positives
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: linting improvements and catching false positives
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: linting improvements and catching false positives
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: increase linter time out
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: wip log analyzer
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: turns off log by default
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: turns off log by default
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Thomas Schuetz <38893055+thschue@users.noreply.github.com>
* feat: adding config audit report
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* feat: adding config audit report
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* feat: adding config audit report analyzer mechnics
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* feat: adding config audit report analyzer mechnics
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* chore: updated naming
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* chore: updated naming
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
* chore: updated var names
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
---------
Signed-off-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Alex Jones <alex@alexs-mbp.tailddc26.ts.net>
Signed-off-by: cleverhu <shouping.hu@daocloud.io>
Signed-off-by: cleverhu <zhubai.hsp@xuelanyun.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: cleverhu <shouping.hu@daocloud.io>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
* chore: fixing edge cases with missing wh service
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: fixing edge cases with missing wh service
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* Update validating_webhook.go
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Aris Boutselis <aris.boutselis@senseon.io>
The PDB event is a historical record, it's not a good choice to judge the pdb latest status based on it.
So, use the `stataus` instead of `event` to check it.
Closes: #476
Signed-off-by: Jian Zhang <jiazha@redhat.com>