ensure that 'crio' is used for k8s config

pull/8593/head
Sunny Beatteay 2020-06-29 19:49:38 -04:00
parent 9bcc587def
commit 28238150f5
3 changed files with 9 additions and 2 deletions

View File

@ -859,13 +859,18 @@ func validateFlags(cmd *cobra.Command, drvName string) {
validOptions := cruntime.ValidRuntimes()
// `crio` is accepted as an alternative spelling to `cri-o`
validOptions = append(validOptions, "crio")
validOptions = append(validOptions, constants.CRIO)
var validRuntime bool
for _, option := range validOptions {
if runtime == option {
validRuntime = true
}
// Convert `cri-o` to `crio` as the K8s config uses the `crio` spelling
if runtime == "cri-o" {
viper.Set(containerRuntime, constants.CRIO)
}
}
if !validRuntime {

View File

@ -281,7 +281,7 @@ func (k *Bootstrapper) applyCNI(cfg config.ClusterConfig) error {
return errors.Wrap(err, "cni apply")
}
if cfg.KubernetesConfig.ContainerRuntime == "crio" {
if cfg.KubernetesConfig.ContainerRuntime == constants.CRIO {
if err := cruntime.UpdateCRIONet(k.c, cnm.CIDR()); err != nil {
return errors.Wrap(err, "update crio")
}

View File

@ -42,6 +42,8 @@ const (
SSHPort = 22
// RegistryAddonPort os the default registry addon port
RegistryAddonPort = 5000
// CRIO is the default name and spelling for the cri-o container runtime
CRIO = "crio"
// APIServerName is the default API server name
APIServerName = "minikubeCA"