From a7bb9ea31e6175d8ae87f7b3c8179419142d592d Mon Sep 17 00:00:00 2001 From: Jason McCampbell Date: Wed, 1 Nov 2023 23:16:18 -0500 Subject: [PATCH] Add support for Oracle OKE environment (#1387) --- examples/preflight/sample-preflight.yaml | 3 +++ pkg/analyze/distribution.go | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/examples/preflight/sample-preflight.yaml b/examples/preflight/sample-preflight.yaml index 6112ffe54..c86950dde 100644 --- a/examples/preflight/sample-preflight.yaml +++ b/examples/preflight/sample-preflight.yaml @@ -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: diff --git a/pkg/analyze/distribution.go b/pkg/analyze/distribution.go index 656c1ca05..8f9624fb7 100644 --- a/pkg/analyze/distribution.go +++ b/pkg/analyze/distribution.go @@ -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