[redis-operator] Changing spec.sentinel.serviceAnnotations
does not update sentinel service's annotation
#77
Labels
bug
Something isn't working
Expected behaviour
I was trying to modify the
spec.sentinel.serviceAnnotations
field to add annotations to theservice/rfs-redisfailover
resource. When adding thekey: value
underspec.sentinel.serviceAnnotations
, I was expecting to see thekey: value
annotation shows up in theservice/rfs-redisfailover
resource.Actual behaviour
But I found that adding key value pairs under this field has no effect.
The field
spec.sentinel.serviceAnnotations
only has effect if it was specified when creating the cluster.Steps to reproduce the behaviour
spec.sentinel.serviceAnnotations
by applying the following yaml file:Observe that nothing changed in the
service/rfs-redisfailover
resource - thekey: value
annotation does not show up.`kubectl get service/rfs-redisfailover -o yaml`
Environment
How are the pieces configured?
quay.io/spotahome/redis-operator:v1.1.0
Logs
I didn't find any related lines regarding this bug in the operator log. The log is attached as a file below
operator.log
Possible root cause and fix
We suspect this behavior is caused by only creating but not updating the service resource. As shown at this line in the code, the service resource is only created if not exist, but never updated: https://github.com/spotahome/redis-operator/blob/6e08a31232077f3e32319a7fde109fad005b8772/operator/redisfailover/service/client.go#L52
Potential fix is to change the
CreateIfNotExistsService
toCreateOrUpdateService
so that the service resource is also updated. We are happy to provide a patch for this.The text was updated successfully, but these errors were encountered: