Skip to content
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

Log when analysers fail to match any outcome conditions #1596

Closed
banjoh opened this issue Aug 19, 2024 · 0 comments · Fixed by #1597
Closed

Log when analysers fail to match any outcome conditions #1596

banjoh opened this issue Aug 19, 2024 · 0 comments · Fixed by #1597

Comments

@banjoh
Copy link
Member

banjoh commented Aug 19, 2024

Describe the rationale for the suggested feature.

If a given list of analysers fails to match in any of the outcome conditions, no result is recorded. Debugging becomes difficult since running preflight with -v flags or --debug, we cannot tell why the analyser was ignored

Example spec

apiVersion: troubleshoot.sh/v1beta2
kind: HostPreflight
metadata:
  name: kurl-builtin
spec:
  collectors:
    - hostOS: {}
  analyzers:
    - hostOS:
        outcomes:
          - pass:
              when: "centos = 7"
              message: "containerd addon supports centos 7"

Sample run

[evans] $ sudo preflight spec.yaml -v=2 --interactive=false
I0819 18:25:02.844416   40332 loader.go:260] Loaded troubleshoot specs successfully
[Host OS Info] Running collector...

============ Collectors summary =============
Succeeded (S), eXcluded (X), Failed (F)
=============================================
Host OS Info (S) : 23ms

============ Redactors summary =============
No redactors executed

============= Analyzers summary =============
Succeeded (S), eXcluded (X), Failed (F)
=============================================
Host OS Info (S) : 0ms

Duration: 25ms
Error: completed with no analysis results

Describe the feature

Add a log line stating that the analysis did not match any analyser outcomes

@banjoh banjoh changed the title Log when analysers fail to match any of the conditions Log when analysers fail to match any outcome conditions Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant