This is an automated email from the ASF dual-hosted git repository.
zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git
The following commit(s) were added to refs/heads/master by this push:
new dcace413 [horus] Pod cleanup strategy (#386)
dcace413 is described below
commit dcace41306926d9ba6318095b74fc08745f23c29
Author: mfordjody <[email protected]>
AuthorDate: Fri Sep 27 13:19:03 2024 +0800
[horus] Pod cleanup strategy (#386)
---
app/horus/core/horuser/pod_abnormal.go | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/app/horus/core/horuser/pod_abnormal.go
b/app/horus/core/horuser/pod_abnormal.go
new file mode 100644
index 00000000..ad533efd
--- /dev/null
+++ b/app/horus/core/horuser/pod_abnormal.go
@@ -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()
+}