OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
731 stars 207 forks source link

Runtime panic error for the operator when a resource is created without storage #921

Closed alita1991 closed 1 month ago

alita1991 commented 1 month ago

What version of redis operator are you using?

redis-operator version: 0.16.0

Does this issue reproduce with the latest release? Yes

What operating system and processor architecture are you using (kubectl version)?

kubectl version Output
$ kubectl version
Client Version: v1.29.3

What did you do? I created a Redis standalone resource without defining the storage resource.

What did you expect to see? Should provision the Redis instance with default config

What did you see instead? Redis operator is in a crash loopback.

{"level":"info","ts":"2024-05-10T08:46:58Z","msg":"Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference","controller":"redis","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"Redis","Redis":{"name":"redis-standalone","namespace":"integration"},"namespace":"integration","name":"redis-standalone","reconcileID":"7fa7d9ba-823f-4d01-9b79-5de377f5dae9"}
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x17854ba]

Additional context The issue was fixed for the Redis cluster 3 days ago via https://github.com/OT-CONTAINER-KIT/redis-operator/pull/887, we probably need to implement a similar solution for redis standalone and redis replication.

drivebyer commented 1 month ago

I have tested Redis replication and Redis standalone with the latest master branch code. The operator will not panic without storage settings. However, I have found another potential panic; it is fixed in #922.