Skip to content

Commit e2f2bc9

Browse files
committed
fix none driver
1 parent 4fbcdfc commit e2f2bc9

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

pkg/minikube/cni/cni.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ func chooseDefault(cc config.ClusterConfig) Manager {
138138
return Bridge{}
139139
}
140140

141-
if driver.BareMetal(cc.Driver) {
142-
klog.Infof("Driver %s used, CNI unnecessary in this configuration, recommending no CNI", cc.Driver)
143-
return Disabled{cc: cc}
144-
}
145-
146141
if len(cc.Nodes) > 1 || cc.MultiNodeRequested {
147142
// Enables KindNet CNI in master in multi node cluster, This solves the network problem
148143
// inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838.

pkg/minikube/cruntime/cruntime.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,7 @@ func ConfigureNetworkPlugin(r Manager, cr CommandRunner, networkPlugin string) e
345345
}
346346
return nil
347347
}
348-
dm, ok := r.(*Docker)
349-
if !ok {
350-
return fmt.Errorf("name and type mismatch")
351-
}
352-
return dockerConfigureNetworkPlugin(*dm, cr, networkPlugin)
348+
return dockerConfigureNetworkPlugin(cr, networkPlugin)
353349
}
354350

355351
// updateCRIDockerdBinary updates cri-dockerd to version

pkg/minikube/cruntime/docker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ const (
699699
CNICacheDir = "/var/lib/cni/cache"
700700
)
701701

702-
func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin string) error {
702+
func dockerConfigureNetworkPlugin(cr CommandRunner, networkPlugin string) error {
703703
// $ cri-dockerd --version
704704
// cri-dockerd 0.2.6 (d8accf7)
705705
// $ cri-dockerd --help | grep -i cni
@@ -738,5 +738,5 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug
738738
if err := cr.Copy(svc); err != nil {
739739
return errors.Wrap(err, "failed to copy template")
740740
}
741-
return r.Init.Restart("cri-docker")
741+
return nil
742742
}

pkg/minikube/node/start.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k
417417
inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true")
418418
// for docker container runtime: ensure containerd is properly configured by calling Enable(), as docker could be bound to containerd
419419
// it will also "soft" start containerd, but it will not disable others; docker will disable containerd if not used in the next step
420-
if co.Type == "docker" {
420+
if co.Type == constants.Docker {
421421
containerd, err := cruntime.New(cruntime.Config{
422-
Type: "containerd",
422+
Type: constants.Containerd,
423423
Socket: "", // use default
424424
Runner: co.Runner,
425425
ImageRepository: co.ImageRepository,
@@ -434,20 +434,17 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k
434434
}
435435

436436
disableOthers := !driver.BareMetal(cc.Driver)
437-
err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace)
438-
if err != nil {
437+
if err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace); err != nil {
439438
exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err)
440439
}
441440

442441
// Wait for the CRI to be "live", before returning it
443-
err = waitForCRISocket(runner, cr.SocketPath(), 60, 1)
444-
if err != nil {
442+
if err = waitForCRISocket(runner, cr.SocketPath(), 60, 1); err != nil {
445443
exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err)
446444
}
447445

448446
// Wait for the CRI to actually work, before returning
449-
err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10)
450-
if err != nil {
447+
if err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10); err != nil {
451448
exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err)
452449
}
453450

0 commit comments

Comments
 (0)