Skip to content

Commit

Permalink
[horus] Pod cleanup strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody committed Sep 27, 2024
1 parent 66f8f19 commit a31e907
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/horus/core/horuser/pod_abnormal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package horuser

import (
"context"
"k8s.io/apimachinery/pkg/util/wait"
"sync"
"time"
)

func (h *Horuser) PodAbnormalCleanManager(ctx context.Context) error {
go wait.UntilWithContext(ctx, h.PodAbnormalClean, time.Duration(h.cc.PodAbnormal.IntervalSecond)*time.Second)
<-ctx.Done()
return nil
}

func (h *Horuser) PodAbnormalClean(ctx context.Context) {
var wg sync.WaitGroup
for cn := range h.cc.PodAbnormal.KubeMultiple {
wg.Add(1)
go func(clusterName string) {
defer wg.Done()
}(cn)
}
wg.Wait()
}

0 comments on commit a31e907

Please sign in to comment.