Open banjoh opened 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?
@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
helm package --dependency-update .
[evans] $ helm template wg-easy-0.0.1.tgz | head -n 30
---
# Source: wg-easy/templates/replicated-library.yaml
apiVersion: v1
kind: Secret
metadata:
name: release-name-wg-easy-support-bundle-replicated
labels:
troubleshoot.sh/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
namespace: kube-system
timeout: 10s
args:
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
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.
default_support_bundles_enabled.yaml
.# Troubleshoot
troubleshoot:
support-bundles:
# Replicated supplied default support bundle spec
replicated:
# -- Enables or disables the Replicated default support bundle
enabled: true
helm dependency update test-chart/
helm template test-chart/ --values test-values/default_support_bundles_enabled.yaml
---
# Source: test/templates/replicated-library.yaml
apiVersion: v1
kind: Secret
metadata:
name: release-name-test-support-bundle-replicated
labels:
troubleshoot.sh/kind: support-bundle
stringData:
support-bundle-spec: |-
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: release-name-test-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
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
namespace: kube-system
timeout: 10s
args:
- --local
- report
- logs:
selector:
name: weave-net
collectorName: weave-net
name: kots/kurl/weave
namespace: kube-system
- logs:
selector:
app: flannel
collectorName: kube-flannel
name: kots/kurl/flannel
namespace: kube-flannel
- collectd:
hostPath: /var/lib/collectd/rrd
image: alpine
collectorName: collectd
timeout: 5m
imagePullPolicy: IfNotPresent
Not the following
exec
collectors are all wrong. The name
& selector
fields in each others places, there is a duplicate fields and indentation is not correct. I expect the spec to look like so
- exec:
name: kots/kurl/weave
selector:
- /home/weave/weave
containerName: weave
namespace: kube-system
timeout: 10s
args:
- --local
- status
- logs:
selector:
- app=api
In the spirit of TDD, https://github.com/replicatedhq/helm-charts/pull/118 is a PR containing a failing test for this bug
Using the version
0.13.3
of thereplicated-library
dependency, the support bundle rendered fromwg-easy
chart looks like below. Note that theselector
fields of theexec
collectors are offChart.lock file of
wg-easy
chart