if cluster-resources/resources.json, do not fail the distribution analyzer
that file was not collected in v0.9.15 and earlier, so we shouldn't require it - particularly since the microk8s/dockerdesktop/eks/gke/DO detection doesn't depend on it
@@ -67,9 +67,9 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
}
apiResourcesBytes, err := getCollectedFileContents("cluster-resources/resources.json")
- if err != nil {
- return nil, errors.Wrap(err, "failed to get contents of resources.json")
- }
+ // if the file is not found, that is not a fatal error
+ // troubleshoot 0.9.15 and earlier did not collect that file
+ if err == nil {
var apiResources []*metav1.APIResourceList
if err := json.Unmarshal(apiResourcesBytes, &apiResources); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal api resource list")
@@ -79,6 +79,7 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
foundProviders.openShift = true
}
}
+ }
result := &AnalyzeResult{
Title: "Kubernetes Distribution",
