Merge pull request #122 from replicatedhq/laverya/properly-identify-openshift-clusters-on-eks

EKS clusters do not have masters within the node list
This commit is contained in:
Andrew Lavery
2020-01-21 12:17:46 -08:00
committed by GitHub

View File

@@ -45,6 +45,7 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
}
foundProviders := providers{}
foundMaster := false
for _, node := range nodes {
for k, v := range node.ObjectMeta.Labels {
@@ -53,6 +54,9 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
} else if k == "kurl.sh/cluster" && v == "true" {
foundProviders.kurl = true
}
if k == "node-role.kubernetes.io/master" {
foundMaster = true
}
}
if node.Status.NodeInfo.OSImage == "Docker Desktop" {
@@ -70,6 +74,11 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
}
}
if foundMaster {
// eks does not have masters within the node list
foundProviders.eks = false
}
apiResourcesBytes, err := getCollectedFileContents("cluster-resources/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