rancher / support-bundle-kit

A toolkit to generate and analyze the support bundles for Kubernetes and Kubernetes-native applications
Apache License 2.0
17 stars 28 forks source link

Log underlying error when YAML generation fails #100

Closed ejweber closed 2 months ago

ejweber commented 6 months ago

Fixes #99 with best-effort.

I can't actually manage to hit an error like the on from https://github.com/rancher/support-bundle-kit/issues/99#issue-2215521652 in my cluster. I tried mangling the cluster-admin ClusterRole to remove access to nonResourceURLs and removing the system:discovery ClusterRoleBinding in an attempt to stop support-bundle-manager from using the Kubernetes Discovery API. This DID result in a support bundle without YAML files, but did not trigger the Unable to fetch cluster resources message (in either a modified or unmodified support-bundle-kit). This means I cannot actually show the result of this PR in action. However, it should provide us additional debugging information if the YAML collection fails again like this in the future.

Vicente-Cheng commented 3 months ago

@ejweber, could you help to rebase for the conflict?

ejweber commented 2 months ago

It looks like @ibrokethecloud beat me to some of these locations, but I think these errors also make sense in the error log, so we should move forward with the changes IMO. Rebased and fixed conflicts.