mirror of
https://github.com/rancher/rke.git
synced 2025-06-27 07:50:30 +00:00
26 lines
524 B
Go
26 lines
524 B
Go
package cluster
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/rancher/rke/hosts"
|
|
"golang.org/x/sync/errgroup"
|
|
)
|
|
|
|
func (c *Cluster) CleanDeadLogs(ctx context.Context) error {
|
|
hostList := hosts.GetUniqueHostList(c.EtcdHosts, c.ControlPlaneHosts, c.WorkerHosts)
|
|
|
|
var errgrp errgroup.Group
|
|
|
|
for _, host := range hostList {
|
|
if !host.UpdateWorker {
|
|
continue
|
|
}
|
|
runHost := host
|
|
errgrp.Go(func() error {
|
|
return hosts.DoRunLogCleaner(ctx, runHost, c.SystemImages.Alpine, c.PrivateRegistriesMap)
|
|
})
|
|
}
|
|
return errgrp.Wait()
|
|
}
|