replicatedhq/troubleshoot

URI is not replacing the spec but merging instead

Closed this issue · 3 comments

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

  • Create a support bundle spec that points to a different one through its URI property.
  • Run with the --dry-run and inspect the merged result.

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

@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

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:~#