@@ -22,6 +22,7 @@ import (
22
22
23
23
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
24
24
// to ensure that exec-entrypoint and run can make use of them.
25
+
25
26
"github.com/go-redis/redis"
26
27
"github.com/jatalocks/kube-reqsizer/controllers"
27
28
"github.com/jatalocks/kube-reqsizer/pkg/cache/rediscache"
@@ -81,18 +82,6 @@ func main() {
81
82
flag .StringVar (& redisPassword , "redis-password" , "" , "Redis password" )
82
83
flag .UintVar (& redisDB , "redis-db" , 0 , "Redis DB number" )
83
84
84
- redisClient := redis .NewClient (& redis.Options {
85
- Addr : redisHost + ":" + redisPort ,
86
- Password : redisPassword , // no password set
87
- DB : int (redisDB ), // use default DB
88
- })
89
- log .Info (& redis.Options {
90
- Addr : redisHost + ":" + redisPort ,
91
- Password : redisPassword , // no password set
92
- DB : int (redisDB ), // use default DB
93
- })
94
- log .Info (redisClient )
95
-
96
85
flag .BoolVar (& enableIncrease , "enable-increase" , true , "Enables the controller to increase pod requests" )
97
86
flag .BoolVar (& enableReduce , "enable-reduce" , true , "Enables the controller to reduce pod requests" )
98
87
flag .Int64Var (& maxMemory , "max-memory" , 0 , "Maximum memory in (Mi) that the controller can set a pod request to. 0 is infinite" )
@@ -120,6 +109,13 @@ func main() {
120
109
opts .BindFlags (flag .CommandLine )
121
110
flag .Parse ()
122
111
112
+ redisClient := redis .NewClient (& redis.Options {
113
+ Addr : redisHost + ":" + redisPort ,
114
+ Password : redisPassword , // no password set
115
+ DB : int (redisDB ), // use default DB
116
+ })
117
+ log .Info (redisClient )
118
+
123
119
ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
124
120
mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
125
121
Scheme : scheme ,
0 commit comments