make a default container runtime constant so that it is easy to change in the future
parent
81d637cd01
commit
b2623d4d4e
|
@ -142,7 +142,7 @@ func initMinikubeFlags() {
|
|||
startCmd.Flags().String(kicBaseImage, kic.BaseImage, "The base image to use for docker/podman drivers. Intended for local development.")
|
||||
startCmd.Flags().Bool(keepContext, false, "This will keep the existing kubectl context and will create a minikube context.")
|
||||
startCmd.Flags().Bool(embedCerts, false, "if true, will embed the certs in kubeconfig.")
|
||||
startCmd.Flags().String(containerRuntime, "docker", fmt.Sprintf("The container runtime to be used (%s).", strings.Join(cruntime.ValidRuntimes(), ", ")))
|
||||
startCmd.Flags().String(containerRuntime, constants.DefaultContainerRuntime, fmt.Sprintf("The container runtime to be used (%s).", strings.Join(cruntime.ValidRuntimes(), ", ")))
|
||||
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.")
|
||||
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.")
|
||||
startCmd.Flags().StringSliceVar(&config.AddonList, "addons", nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
|
||||
|
|
|
@ -45,6 +45,8 @@ const (
|
|||
RegistryAddonPort = 5000
|
||||
// CRIO is the default name and spelling for the cri-o container runtime
|
||||
CRIO = "crio"
|
||||
// DefaultContainerRuntime is our default container runtime
|
||||
DefaultContainerRuntime = "docker"
|
||||
|
||||
// APIServerName is the default API server name
|
||||
APIServerName = "minikubeCA"
|
||||
|
|
|
@ -27,6 +27,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/constants"
|
||||
"k8s.io/minikube/pkg/minikube/driver"
|
||||
)
|
||||
|
||||
|
@ -133,7 +134,7 @@ func KicDriver() bool {
|
|||
func ContainerRuntime() string {
|
||||
flag := "--container-runtime="
|
||||
if !strings.Contains(*startArgs, flag) {
|
||||
return "docker"
|
||||
return constants.DefaultContainerRuntime
|
||||
}
|
||||
for _, s := range StartArgs() {
|
||||
if strings.HasPrefix(s, flag) {
|
||||
|
|
Loading…
Reference in New Issue