replicatedhq / helm-charts

Apache License 2.0
4 stars 6 forks source link

Invalid support bundle spec rendered from wg-easy chart #98

Open banjoh opened 1 year ago

banjoh commented 1 year ago

Using the version 0.13.3 of the replicated-library dependency, the support bundle rendered from wg-easy chart looks like below. Note that the selector fields of the exec collectors are off

---
# Source: wg-easy/templates/replicated-library.yaml
apiVersion: v1
kind: Secret
metadata:
  name: release-name-wg-easy-support-bundle-replicated
  labels:
    troubleshoot.io/kind: support-bundle
stringData:
  support-bundle-spec: |-
    apiVersion: troubleshoot.sh/v1beta2
    kind: SupportBundle
    metadata:
      name: release-name-wg-easy-support-bundle-replicated
    spec:
      collectors:
        - clusterInfo: {}
        - clusterResources: {}
        - ceph: {}
        - longhorn: {}
        - exec:
            selector:
              name: weave-net
              - /home/weave/weave
            collectorName: weave-status
            name: kots/kurl/weave
            containerName: weave
            name: kots/kurl/weave
            namespace: kube-system
            timeout: 10s
            args:
              - --local
              - status
        - exec:
            selector:
              name: weave-net
              - /home/weave/weave
            collectorName: weave-report
            name: kots/kurl/weave
            containerName: weave
            name: kots/kurl/weave
            namespace: kube-system
            timeout: 10s
            args:
              - --local
              - report

Chart.lock file of wg-easy chart

dependencies:
- name: replicated-library
  repository: https://replicatedhq.github.io/helm-charts
  version: 0.13.3
digest: sha256:29a74f7d1fe860c12e76e3a959dee8b8a8c9ea44e84162910fcf964a723374a2
generated: "2023-06-02T13:40:09.475514+01:00"
chris-sanders commented 1 year ago

@banjoh this chat has been removed, can you clarify what the bug is in the library chart specifically if this still aplies?

banjoh commented 1 year ago

@chris-sanders the bug is in the library, I believe here

I used the moved wg-easy chart and recreated the same bug. Here are the steps

The support bundle spec is enabled/disabled using the values below which can be seen here

# Troubleshoot
troubleshoot:
  support-bundles:
    # Replicated supplied default support bundle spec
    replicated:
      # -- Enables or disables the Replicated default support bundle
      enabled: true
chris-sanders commented 1 year ago

Since this chart is no longer part of this repository I propose demonstrating the issue with the new testing functionality so that it's both clear how to cause it, and we can use that test to develop TDD solution as well.

banjoh commented 1 year ago

Not the following

banjoh commented 1 year ago

In the spirit of TDD, https://github.com/replicatedhq/helm-charts/pull/118 is a PR containing a failing test for this bug