we don't disable other container engines when vmdriver==none

pull/4545/head
Marcos Diez 2019-06-20 13:06:22 -03:00
parent 62c0d53b7d
commit ba20534107
5 changed files with 18 additions and 11 deletions

View File

@ -684,7 +684,8 @@ func configureRuntimes(runner cruntime.CommandRunner) cruntime.Manager {
exit.WithError(fmt.Sprintf("Failed runtime for %+v", config), err)
}
err = cr.Enable()
disableOtherContainerEngines := viper.GetString(vmDriver) != constants.DriverNone
err = cr.Enable(disableOtherContainerEngines)
if err != nil {
exit.WithError("Failed to enable container runtime", err)
}

View File

@ -79,9 +79,11 @@ func (r *Containerd) Available() error {
}
// Enable idempotently enables containerd on a host
func (r *Containerd) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *Containerd) Enable(disableOtherContainerEngines bool) error {
if disableOtherContainerEngines {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
return err

View File

@ -78,9 +78,11 @@ func (r *CRIO) Active() bool {
}
// Enable idempotently enables CRIO on a host
func (r *CRIO) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *CRIO) Enable(disableOtherContainerEngines bool) error {
if disableOtherContainerEngines {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
return err

View File

@ -38,7 +38,7 @@ type Manager interface {
// Version retrieves the current version of this runtime
Version() (string, error)
// Enable idempotently enables this runtime on a host
Enable() error
Enable(bool) error
// Disable idempotently disables this runtime on a host
Disable() error
// Active returns whether or not a runtime is active on a host

View File

@ -75,9 +75,11 @@ func (r *Docker) Active() bool {
}
// Enable idempotently enables Docker on a host
func (r *Docker) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *Docker) Enable(disableOtherContainerEngines bool) error {
if disableOtherContainerEngines {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
return r.Runner.Run("sudo systemctl start docker")
}