Skip to content

Commit 037e1f1

Browse files
committed
✏️ fix typo in redis conn
modified: charts/kube-reqsizer/templates/deployment.yaml; modified: main.go
1 parent 8749719 commit 037e1f1

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

charts/kube-reqsizer/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
- --memory-factor={{.Values.memoryFactor}}
3939
- --concurrent-workers={{.Values.concurrentWorkers}}
4040
- --enable-persistence={{.Values.persistence.enabled}}
41-
- --redis-host="{{.Release.Name}}-redis-master"
41+
- --redis-host={{.Release.Name}}-redis-master
4242
resources:
4343
{{- toYaml .Values.controllerManager.manager.resources | nindent 10 }}
4444
command:

main.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2424
// to ensure that exec-entrypoint and run can make use of them.
25+
2526
"github.com/go-redis/redis"
2627
"github.com/jatalocks/kube-reqsizer/controllers"
2728
"github.com/jatalocks/kube-reqsizer/pkg/cache/rediscache"
@@ -81,18 +82,6 @@ func main() {
8182
flag.StringVar(&redisPassword, "redis-password", "", "Redis password")
8283
flag.UintVar(&redisDB, "redis-db", 0, "Redis DB number")
8384

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-
9685
flag.BoolVar(&enableIncrease, "enable-increase", true, "Enables the controller to increase pod requests")
9786
flag.BoolVar(&enableReduce, "enable-reduce", true, "Enables the controller to reduce pod requests")
9887
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() {
120109
opts.BindFlags(flag.CommandLine)
121110
flag.Parse()
122111

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+
123119
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
124120
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
125121
Scheme: scheme,

0 commit comments

Comments
 (0)