1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 06:34:03 +00:00
Files
rke/services/scheduler.go

29 lines
1.1 KiB
Go
Raw Normal View History

2017-10-29 11:45:21 +02:00
package services
import (
"context"
2017-11-14 20:11:21 +02:00
"github.com/rancher/rke/docker"
2017-10-29 11:45:21 +02:00
"github.com/rancher/rke/hosts"
2017-12-05 09:55:58 -07:00
"github.com/rancher/types/apis/management.cattle.io/v3"
2017-10-29 11:45:21 +02:00
)
func runScheduler(ctx context.Context, host *hosts.Host, df hosts.DialerFactory, prsMap map[string]v3.PrivateRegistry, schedulerProcess v3.Process, alpineImage string) error {
2018-02-26 16:27:54 -07:00
imageCfg, hostCfg, healthCheckURL := GetProcessConfig(schedulerProcess)
if err := docker.DoRunContainer(ctx, host.DClient, imageCfg, hostCfg, SchedulerContainerName, host.Address, ControlRole, prsMap); err != nil {
return err
}
if err := runHealthcheck(ctx, host, SchedulerContainerName, df, healthCheckURL, nil); err != nil {
return err
}
return createLogLink(ctx, host, SchedulerContainerName, ControlRole, alpineImage, prsMap)
2017-10-29 11:45:21 +02:00
}
func removeScheduler(ctx context.Context, host *hosts.Host) error {
return docker.DoRemoveContainer(ctx, host.DClient, SchedulerContainerName, host.Address)
}
2018-08-20 06:37:04 +02:00
2019-01-14 19:51:20 +02:00
func RestartScheduler(ctx context.Context, host *hosts.Host) error {
2018-08-20 06:37:04 +02:00
return docker.DoRestartContainer(ctx, host.DClient, SchedulerContainerName, host.Address)
}