troubleshoot
troubleshoot copied to clipboard
Secrets/configMaps that contain specs have a confusing and non-intuitive key name requirement
Bug Description
When writing secrets or configmaps to contain support-bundle or preflight specs, the resources need to have a label to identify them as such. In addition, the data item needs a specific key for the data to be located in.
For preflight: preflight.yaml
for support-bundle: support-bundle-spec
This is inconsistent, and actually unnecessary if there is only one data key.
Expected Behavior
The Troubleshoot binary uses the entire data from the secret or configmap, regardless of the key name. It could, conceivably, iterate over all data items in the resource collecting a spec from each.
The relevant code that handles this behaviour is https://github.com/replicatedhq/troubleshoot/blob/1dedbcd67a444a9d5223624a42c78b9112be2947/pkg/loader/loader.go#L240-L289