File tree 6 files changed +22
-12
lines changed
6 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -751,7 +751,11 @@ func configureRuntimes(runner cruntime.CommandRunner) cruntime.Manager {
751
751
exit .WithError (fmt .Sprintf ("Failed runtime for %+v" , config ), err )
752
752
}
753
753
754
- err = cr .Enable ()
754
+ disableOthers := true
755
+ if viper .GetString (vmDriver ) == constants .DriverNone {
756
+ disableOthers = false
757
+ }
758
+ err = cr .Enable (disableOthers )
755
759
if err != nil {
756
760
exit .WithError ("Failed to enable container runtime" , err )
757
761
}
Original file line number Diff line number Diff line change @@ -80,9 +80,11 @@ func (r *Containerd) Available() error {
80
80
}
81
81
82
82
// Enable idempotently enables containerd on a host
83
- func (r * Containerd ) Enable () error {
84
- if err := disableOthers (r , r .Runner ); err != nil {
85
- glog .Warningf ("disableOthers: %v" , err )
83
+ func (r * Containerd ) Enable (disOthers bool ) error {
84
+ if disOthers {
85
+ if err := disableOthers (r , r .Runner ); err != nil {
86
+ glog .Warningf ("disableOthers: %v" , err )
87
+ }
86
88
}
87
89
if err := populateCRIConfig (r .Runner , r .SocketPath ()); err != nil {
88
90
return err
Original file line number Diff line number Diff line change @@ -78,9 +78,11 @@ func (r *CRIO) Active() bool {
78
78
}
79
79
80
80
// Enable idempotently enables CRIO on a host
81
- func (r * CRIO ) Enable () error {
82
- if err := disableOthers (r , r .Runner ); err != nil {
83
- glog .Warningf ("disableOthers: %v" , err )
81
+ func (r * CRIO ) Enable (disOthers bool ) error {
82
+ if disOthers {
83
+ if err := disableOthers (r , r .Runner ); err != nil {
84
+ glog .Warningf ("disableOthers: %v" , err )
85
+ }
84
86
}
85
87
if err := populateCRIConfig (r .Runner , r .SocketPath ()); err != nil {
86
88
return err
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ type Manager interface {
38
38
// Version retrieves the current version of this runtime
39
39
Version () (string , error )
40
40
// Enable idempotently enables this runtime on a host
41
- Enable () error
41
+ Enable (bool ) error
42
42
// Disable idempotently disables this runtime on a host
43
43
Disable () error
44
44
// Active returns whether or not a runtime is active on a host
Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ func TestEnable(t *testing.T) {
406
406
if err != nil {
407
407
t .Fatalf ("New(%s): %v" , tc .runtime , err )
408
408
}
409
- err = cr .Enable ()
409
+ err = cr .Enable (true )
410
410
if err != nil {
411
411
t .Errorf ("%s disable unexpected error: %v" , tc .runtime , err )
412
412
}
Original file line number Diff line number Diff line change @@ -78,9 +78,11 @@ func (r *Docker) Active() bool {
78
78
}
79
79
80
80
// Enable idempotently enables Docker on a host
81
- func (r * Docker ) Enable () error {
82
- if err := disableOthers (r , r .Runner ); err != nil {
83
- glog .Warningf ("disableOthers: %v" , err )
81
+ func (r * Docker ) Enable (disOthers bool ) error {
82
+ if disOthers {
83
+ if err := disableOthers (r , r .Runner ); err != nil {
84
+ glog .Warningf ("disableOthers: %v" , err )
85
+ }
84
86
}
85
87
return r .Runner .Run ("sudo systemctl start docker" )
86
88
}
You can’t perform that action at this time.
0 commit comments