Skip to content

Add parameterize SupportBundle spec support #1556

Closed
@nashtsai

Description

@nashtsai

Describe the rationale for the suggested feature.

There are a number of collectors that required parameterize values, i.e., helm, for every different input value, it requires us generating new supportbundle yaml from a template, which is rather tedious.

Describe the feature

Have CLI tool accept key-value args and SupportBundle spec support template syntax

# file: helm-collector.yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - helm:
        # support templating, i.e., helm/go 
        releaseName: {{ .Values.releaseName }}
        # if not specified, scan all namespaces
        {{- if .Values.namespace }}
        namespace: {{  .Values.namespace }}
        {{- end }}

Run CLI command as:

kubectl support-bundle --template helm-collector.yaml --set releaseName=mysql-1692919203

Expecting same result as running following SupportBundle spec

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - helm:
        releaseName: mysql-1692919203

Describe alternatives you've considered

Wrap support-bundle plugin with support-bundle-template python script and handle template rending in python.

Additional context

Add additional context about the feature request. If the change is substantial, consider attaching files to the issue outlining architectural changes, data flows, file formats etc., anything that helps describe the requested change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions