[BUG] OT-CONTAINER-KIT/redis-operator: An incomplete cr.spec.kubernetesConfig.redisSecret
causes nil-pointer reference inside operator
#106
Labels
bug
Something isn't working
What version of redis operator are you using?
redis-operator version: We are using redis-operator built from the
HEAD
and built from the latest releaseDoes this issue reproduce with the latest release?
Yes, the problem reproduces with
quay.io/opstree/redis-operator:v0.10.0
What operating system and processor architecture are you using (
kubectl version
)?kubectl version
OutputWhat did you do?
To reproduce, apply the below cr file
cr_cluster.yaml
Observe that the operator crashes and restarts. Below is the operator crash log:
kubectl logs deployment.apps/redis-operator -n redis-operator
outputWhat did you expect to see?
Redis-operator does not crash and (perhaps) rejecting the cr input.
What did you see instead?
Redis-operator crashed with the forementioned cr yaml file
Possible root cause
Neither
key
norname
are required under the fieldcr.spec.kubernetesConfig.redisSecret
according to the CRD #L155-L163 inside the operator repo.The operator crashes due to a nil-pointer reference when only one of the two fields:
key
andname
is specified. The nil pointer reference is at https://github.com/OT-CONTAINER-KIT/redis-operator/blob/f1c547e26ece015c0c5cd8a8549ff277e8e7c2ab/k8sutils/statefulset.go#L412-L414The text was updated successfully, but these errors were encountered: