Add support for Oracle OKE environment (#1387)

This commit is contained in:
Jason McCampbell
2023-11-02 17:16:18 +13:00
committed by GitHub
parent 08c3fcf3df
commit a7bb9ea31e
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -72,6 +72,9 @@ spec:
- pass:
when: "== k3s"
message: K3S is a supported distribution
- pass:
when: "== oke"
message: OKE is a supported distribution
- warn:
message: Unable to determine the distribution of Kubernetes
- nodeResources:
+11
View File
@@ -26,6 +26,7 @@ type providers struct {
minikube bool
rke2 bool
k3s bool
oke bool
}
type Provider int
@@ -45,6 +46,7 @@ const (
minikube Provider = iota
rke2 Provider = iota
k3s Provider = iota
oke Provider = iota
)
type AnalyzeDistribution struct {
@@ -125,6 +127,11 @@ func ParseNodesForProviders(nodes []corev1.Node) (providers, string) {
foundProviders.k3s = true
stringProvider = "k3s"
}
if k == "oci.oraclecloud.com/fault-domain" {
// Based on: https://docs.oracle.com/en-us/iaas/Content/ContEng/Reference/contengsupportedlabelsusecases.htm
foundProviders.oke = true
stringProvider = "oke"
}
}
for k := range node.ObjectMeta.Annotations {
@@ -326,6 +333,8 @@ func compareDistributionConditionalToActual(conditional string, actual providers
isMatch = actual.rke2
case k3s:
isMatch = actual.k3s
case oke:
isMatch = actual.oke
}
switch parts[0] {
@@ -366,6 +375,8 @@ func mustNormalizeDistributionName(raw string) Provider {
return rke2
case "k3s":
return k3s
case "oke":
return oke
}
return unknown