mirror of
https://github.com/rancher/rke.git
synced 2025-09-16 15:10:12 +00:00
Add Rotate certificates command to rke
This commit is contained in:
committed by
Alena Prokharchyk
parent
7582083e7a
commit
3551e6e4b6
@@ -72,6 +72,30 @@ func RunEtcdPlane(
|
||||
return nil
|
||||
}
|
||||
|
||||
func RestartEtcdPlane(ctx context.Context, etcdHosts []*hosts.Host) error {
|
||||
log.Infof(ctx, "[%s] Restarting up etcd plane..", ETCDRole)
|
||||
var errgrp errgroup.Group
|
||||
|
||||
hostsQueue := util.GetObjectQueue(etcdHosts)
|
||||
for w := 0; w < WorkerThreads; w++ {
|
||||
errgrp.Go(func() error {
|
||||
var errList []error
|
||||
for host := range hostsQueue {
|
||||
runHost := host.(*hosts.Host)
|
||||
if err := docker.DoRestartContainer(ctx, runHost.DClient, EtcdContainerName, runHost.Address); err != nil {
|
||||
errList = append(errList, err)
|
||||
}
|
||||
}
|
||||
return util.ErrList(errList)
|
||||
})
|
||||
}
|
||||
if err := errgrp.Wait(); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof(ctx, "[%s] Successfully restarted etcd plane..", ETCDRole)
|
||||
return nil
|
||||
}
|
||||
|
||||
func RemoveEtcdPlane(ctx context.Context, etcdHosts []*hosts.Host, force bool) error {
|
||||
log.Infof(ctx, "[%s] Tearing down etcd plane..", ETCDRole)
|
||||
|
||||
|
Reference in New Issue
Block a user