replicatedhq / troubleshoot

Preflight Checks and Support Bundles Framework for Kubernetes Applications
https://troubleshoot.sh
Apache License 2.0
539 stars 92 forks source link

Mergable specs missing some collectors if one of the specs has a uri field #1540

Closed banjoh closed 2 months ago

banjoh commented 2 months ago

Bug Description

When merging specs, and one of the specs happens to be updatable i.e has the uri field defined, the resulting merged spec ends up missing some of the collectors defined.

Expected Behavior

All specs (collectors/analysers/redactors) should be present in the merged spec.

Steps To Reproduce

Create sample data spec

cat << EOF > spec.yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
spec:
  collectors:
    - data:
        name: sample-data.txt
        data: |
          any static
          data can be used here
EOF

Using the newest version of support-bundle, dry-run using the command below and search for sample-data.txt. Note that sample-data.txt is missing

[evans] $ support-bundle version
Replicated Troubleshoot v0.91.0
[evans] $ support-bundle --dry-run spec.yaml https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml | grep sample-data.txt; echo $?
1

In an older version of support bundle, this issue is absent

[evans] $ support-bundle version
Replicated Troubleshoot v0.90.0
[evans] $ support-bundle --dry-run spec.yaml https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml | grep sample-data.txt
      name: sample-data.txt
banjoh commented 2 months ago

v0.92.0 seems to have this bug fixed.

$ support-bundle version
Replicated Troubleshoot v0.92.0
$ support-bundle --dry-run spec.yaml https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml | grep sample-data.txt;
      name: sample-data.txt