Skip to content

Commit a7bb9ea

Browse files
Add support for Oracle OKE environment (#1387)
1 parent 08c3fcf commit a7bb9ea

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

examples/preflight/sample-preflight.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ spec:
7272
- pass:
7373
when: "== k3s"
7474
message: K3S is a supported distribution
75+
- pass:
76+
when: "== oke"
77+
message: OKE is a supported distribution
7578
- warn:
7679
message: Unable to determine the distribution of Kubernetes
7780
- nodeResources:

pkg/analyze/distribution.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type providers struct {
2626
minikube bool
2727
rke2 bool
2828
k3s bool
29+
oke bool
2930
}
3031

3132
type Provider int
@@ -45,6 +46,7 @@ const (
4546
minikube Provider = iota
4647
rke2 Provider = iota
4748
k3s Provider = iota
49+
oke Provider = iota
4850
)
4951

5052
type AnalyzeDistribution struct {
@@ -125,6 +127,11 @@ func ParseNodesForProviders(nodes []corev1.Node) (providers, string) {
125127
foundProviders.k3s = true
126128
stringProvider = "k3s"
127129
}
130+
if k == "oci.oraclecloud.com/fault-domain" {
131+
// Based on: https://docs.oracle.com/en-us/iaas/Content/ContEng/Reference/contengsupportedlabelsusecases.htm
132+
foundProviders.oke = true
133+
stringProvider = "oke"
134+
}
128135
}
129136

130137
for k := range node.ObjectMeta.Annotations {
@@ -326,6 +333,8 @@ func compareDistributionConditionalToActual(conditional string, actual providers
326333
isMatch = actual.rke2
327334
case k3s:
328335
isMatch = actual.k3s
336+
case oke:
337+
isMatch = actual.oke
329338
}
330339

331340
switch parts[0] {
@@ -366,6 +375,8 @@ func mustNormalizeDistributionName(raw string) Provider {
366375
return rke2
367376
case "k3s":
368377
return k3s
378+
case "oke":
379+
return oke
369380
}
370381

371382
return unknown

0 commit comments

Comments
 (0)