@@ -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