Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Oracle OKE environment #1387

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/preflight/sample-preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions pkg/analyze/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type providers struct {
minikube bool
rke2 bool
k3s bool
oke bool
}

type Provider int
Expand All @@ -45,6 +46,7 @@ const (
minikube Provider = iota
rke2 Provider = iota
k3s Provider = iota
oke Provider = iota
)

type AnalyzeDistribution struct {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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] {
Expand Down Expand Up @@ -366,6 +375,8 @@ func mustNormalizeDistributionName(raw string) Provider {
return rke2
case "k3s":
return k3s
case "oke":
return oke
}

return unknown
Expand Down
Loading