replicatedhq / troubleshoot

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

URI is not replacing the spec but merging instead #1486

Closed ricardomaraschini closed 4 months ago

ricardomaraschini commented 6 months ago

Bug Description

When I use the spec.uri of a support bundle the documentation states the the version pointed by spec.uri replaces the spec but it is actually merging the two specs.

Expected Behavior

The version pointed by spec.uri replaces the version being applied.

Steps To Reproduce

chris-sanders commented 6 months ago

@ricardomaraschini do you have an example that demonstrates how you reproduce this?

ricardomaraschini commented 6 months ago

@chris-sanders

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: embedded-cluster-kotsadm-support-bundle
  labels:
    troubleshoot.io/kind: support-bundle
spec:
  uri: https://gist.githubusercontent.com/ricardomaraschini/8311a61dcb6307559f7fed7db979ec90/raw/b37965b733b76370bb936cb306248f4f51db2952/yaml
  collectors:
  - logs:
      name: podlogs/kotsadm
      selector:
      - app=kotsadm
      limits:
        maxAge: 720h
ricardomaraschini commented 6 months ago

For completenes:

root@ec:~# kubectl support-bundle ./bundle-you-see-above.yaml --dry-run
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  creationTimestamp: null
  name: merged-support-bundle-spec
spec:
  collectors:
  - logs:
      limits:
        maxAge: 720h
        sinceTime: null
      name: podlogs/kotsadm
      selector:
      - app=kotsadm
  - logs:
      limits:
        maxAge: 720h
        sinceTime: null
      name: podlogs/kotsadm
      selector:
      - app=another
  - clusterInfo: {}
  - clusterResources: {}
status: {}
root@ec:~#