Skip to content

Commit 58b6424

Browse files
authored
Merge pull request #122 from replicatedhq/laverya/properly-identify-openshift-clusters-on-eks
EKS clusters do not have masters within the node list
2 parents ecfe34f + 6fe9e2e commit 58b6424

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/analyze/distribution.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
4545
}
4646

4747
foundProviders := providers{}
48+
foundMaster := false
4849

4950
for _, node := range nodes {
5051
for k, v := range node.ObjectMeta.Labels {
@@ -53,6 +54,9 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
5354
} else if k == "kurl.sh/cluster" && v == "true" {
5455
foundProviders.kurl = true
5556
}
57+
if k == "node-role.kubernetes.io/master" {
58+
foundMaster = true
59+
}
5660
}
5761

5862
if node.Status.NodeInfo.OSImage == "Docker Desktop" {
@@ -70,6 +74,11 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
7074
}
7175
}
7276

77+
if foundMaster {
78+
// eks does not have masters within the node list
79+
foundProviders.eks = false
80+
}
81+
7382
apiResourcesBytes, err := getCollectedFileContents("cluster-resources/resources.json")
7483
// if the file is not found, that is not a fatal error
7584
// troubleshoot 0.9.15 and earlier did not collect that file

0 commit comments

Comments
 (0)