change panic to fatal log
This commit is contained in:
45
internal/config/utilits.go
Normal file
45
internal/config/utilits.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"slices"
|
||||
)
|
||||
|
||||
var kubernetesVersions = []string{
|
||||
"1.32.5",
|
||||
"1.32.4",
|
||||
"1.32.3",
|
||||
"1.32.2",
|
||||
"1.32.1",
|
||||
"1.32.0",
|
||||
"1.31.9",
|
||||
"1.31.8",
|
||||
"1.31.7",
|
||||
"1.31.6",
|
||||
"1.31.5",
|
||||
"1.31.4",
|
||||
"1.31.3",
|
||||
"1.31.2",
|
||||
"1.31.1",
|
||||
"1.31.0",
|
||||
"1.30.13",
|
||||
"1.30.12",
|
||||
"1.30.11",
|
||||
"1.30.10",
|
||||
"1.30.9",
|
||||
"1.30.8",
|
||||
"1.30.7",
|
||||
"1.30.6",
|
||||
"1.30.5",
|
||||
"1.30.4",
|
||||
"1.30.3",
|
||||
"1.30.2",
|
||||
"1.30.1",
|
||||
"1.30.0",
|
||||
}
|
||||
|
||||
func validateConfig(cfg Config) error {
|
||||
if !slices.Contains(kubernetesVersions, cfg.Orchestrator.Version) {
|
||||
return &UnsupportedK8sVersion{Version: cfg.Orchestrator.Version}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user