File tree 2 files changed +22
-22
lines changed
2 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -6,37 +6,15 @@ import (
6
6
"math"
7
7
"net/http"
8
8
"os/exec"
9
- "slices"
10
9
"strconv"
11
10
"strings"
12
- "sync"
13
11
"time"
14
12
15
13
"github.com/rs/zerolog/log"
16
14
"github.com/unagex/kondense/pkg/utils"
17
15
corev1 "k8s.io/api/core/v1"
18
16
)
19
17
20
- func (r * Reconciler ) ReconcileContainer (pod * corev1.Pod , container corev1.Container , wg * sync.WaitGroup ) {
21
- defer wg .Done ()
22
-
23
- exclude := utils .ContainersToExclude ()
24
- if slices .Contains (exclude , container .Name ) {
25
- return
26
- }
27
-
28
- err := r .UpdateStats (pod , container )
29
- if err != nil {
30
- log .Error ().Err (err )
31
- return
32
- }
33
-
34
- err = r .KondenseContainer (container )
35
- if err != nil {
36
- log .Error ().Err (err )
37
- }
38
- }
39
-
40
18
func (r * Reconciler ) UpdateStats (pod * corev1.Pod , container corev1.Container ) error {
41
19
var err error
42
20
var output []byte
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ package controller
3
3
import (
4
4
"context"
5
5
"net/http"
6
+ "slices"
6
7
"sync"
7
8
"time"
8
9
9
10
"github.com/rs/zerolog/log"
11
+ "github.com/unagex/kondense/pkg/utils"
10
12
corev1 "k8s.io/api/core/v1"
11
13
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
14
"k8s.io/client-go/kubernetes"
@@ -59,3 +61,23 @@ func (r *Reconciler) Reconcile() {
59
61
loopTime = time .Since (start )
60
62
}
61
63
}
64
+
65
+ func (r * Reconciler ) ReconcileContainer (pod * corev1.Pod , container corev1.Container , wg * sync.WaitGroup ) {
66
+ defer wg .Done ()
67
+
68
+ exclude := utils .ContainersToExclude ()
69
+ if slices .Contains (exclude , container .Name ) {
70
+ return
71
+ }
72
+
73
+ err := r .UpdateStats (pod , container )
74
+ if err != nil {
75
+ log .Error ().Err (err )
76
+ return
77
+ }
78
+
79
+ err = r .KondenseContainer (container )
80
+ if err != nil {
81
+ log .Error ().Err (err )
82
+ }
83
+ }
You can’t perform that action at this time.
0 commit comments