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

Outcomes title field ignored by analysers #1093

Open
banjoh opened this issue Apr 3, 2023 · 0 comments
Open

Outcomes title field ignored by analysers #1093

banjoh opened this issue Apr 3, 2023 · 0 comments
Labels
type::bug Something isn't working

Comments

@banjoh
Copy link
Member

banjoh commented Apr 3, 2023

Bug Description

Analysis result outcomes have an optional title field which can be used when multiple outcomes are defined, and when one would like to give specific outcomes more meaning by providing a more descriptive title.

Steps To Reproduce

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: kurl-builtin-oncluster
spec:
  collectors:
    - clusterResources: {}
    - clusterInfo: {}
  analyzers:
    - clusterPodStatuses:
        checkName: "Pod(s) health status(es)"
        outcomes:
          - fail:
              title: "Pod {{ .Name }} is unable to pull images"
              when: "== ImagePullBackOff"
              message: "A Pod, {{ .Name }}, is unable to pull its image. Status is: {{ .Status.Reason }}"
          - warn:
              title: "Pod {{ .Name }} is unhealthy"
              when: "!= Healthy"
              message: "A Pod, {{ .Name }}, is unhealthy with a status of: {{ .Status.Reason }}. Restarting the pod may fix the issue."
          - pass:
              title: "Pod {{ .Name }} is healthy"
              message: "Pod {{ .Name }} is healthy"

Collecting a support bundle using the spec above, where we have some failing pods, would render an analysis like below

image

Expected Behavior

We expect to get results like below where each of the outcomes has a title with more context

Screenshot 2023-04-03 at 11 53 46

Additional Context

  • This struct that holds the title field is here
  • Each analyser will need to be updated to consume the additional title field. At the moment each analyser by default uses the the anaylyser's checkName property as the title or a hard coded string. Take a look at the pod status analyser for example

Include the following information.

  • Troubleshoot version: Affect all versions of troubleshoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant