Skip to content

Commit 56fa2b9

Browse files
committed
ensure that 'crio' is used for k8s config
1 parent 9bcc587 commit 56fa2b9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Diff for: cmd/minikube/cmd/start.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -859,13 +859,18 @@ func validateFlags(cmd *cobra.Command, drvName string) {
859859

860860
validOptions := cruntime.ValidRuntimes()
861861
// `crio` is accepted as an alternative spelling to `cri-o`
862-
validOptions = append(validOptions, "crio")
862+
validOptions = append(validOptions, constants.CRIO)
863863

864864
var validRuntime bool
865865
for _, option := range validOptions {
866866
if runtime == option {
867867
validRuntime = true
868868
}
869+
870+
// Convert `cri-o` to `crio` as the K8s config uses the `crio` spelling
871+
if runtime == "cri-o" {
872+
viper.Set(containerRuntime, constants.CRIO)
873+
}
869874
}
870875

871876
if !validRuntime {

Diff for: pkg/minikube/bootstrapper/kubeadm/kubeadm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func (k *Bootstrapper) applyCNI(cfg config.ClusterConfig) error {
281281
return errors.Wrap(err, "cni apply")
282282
}
283283

284-
if cfg.KubernetesConfig.ContainerRuntime == "crio" {
284+
if cfg.KubernetesConfig.ContainerRuntime == constants.CRIO {
285285
if err := cruntime.UpdateCRIONet(k.c, cnm.CIDR()); err != nil {
286286
return errors.Wrap(err, "update crio")
287287
}

Diff for: pkg/minikube/constants/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const (
4242
SSHPort = 22
4343
// RegistryAddonPort os the default registry addon port
4444
RegistryAddonPort = 5000
45+
// CRIO is the default spelling for the cri-o container runtime
46+
CRIO = "crio"
4547

4648
// APIServerName is the default API server name
4749
APIServerName = "minikubeCA"

0 commit comments

Comments
 (0)