Skip to content

Commit ecfe34f

Browse files
authored
Merge pull request #121 from replicatedhq/kurl-installations
Identify kurl clusters with distribution analyzer
2 parents 5d280ae + 190eeef commit ecfe34f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/analyze/distribution.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type providers struct {
1717
gke bool
1818
digitalOcean bool
1919
openShift bool
20+
kurl bool
2021
}
2122

2223
type Provider int
@@ -29,6 +30,7 @@ const (
2930
gke Provider = iota
3031
digitalOcean Provider = iota
3132
openShift Provider = iota
33+
kurl Provider = iota
3234
)
3335

3436
func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollectedFileContents func(string) ([]byte, error)) (*AnalyzeResult, error) {
@@ -48,6 +50,8 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
4850
for k, v := range node.ObjectMeta.Labels {
4951
if k == "microk8s.io/cluster" && v == "true" {
5052
foundProviders.microk8s = true
53+
} else if k == "kurl.sh/cluster" && v == "true" {
54+
foundProviders.kurl = true
5155
}
5256
}
5357

@@ -192,6 +196,8 @@ func compareDistributionConditionalToActual(conditional string, actual providers
192196
isMatch = actual.digitalOcean
193197
case openShift:
194198
isMatch = actual.openShift
199+
case kurl:
200+
isMatch = actual.kurl
195201
}
196202

197203
switch parts[0] {
@@ -218,6 +224,8 @@ func mustNormalizeDistributionName(raw string) Provider {
218224
return digitalOcean
219225
case "openshift":
220226
return openShift
227+
case "kurl":
228+
return kurl
221229
}
222230

223231
return unknown

0 commit comments

Comments
 (0)