pravega / zookeeper-operator

Kubernetes Operator for Zookeeper
Apache License 2.0
368 stars 206 forks source link

Inconsistent probe default values when changing the probe configs versus deploying #541

Open hoyhbx opened 1 year ago

hoyhbx commented 1 year ago

Description

(Describe the feature, bug, question, proposal that you are requesting) We found that the configurations for the readinessProbe and livenessProbe are only set with default value when the entire probe configuration is nil. When we do not specify any probe configuration, all the configs, e.g. initialDelaySeconds, timeout_seconds are set with default values, such as 10 seconds. Then when we deploy the zookeeper cluster with spec.probes.livenessProbe.initialDelaySeconds as 5 seonds, all other fields are set with 1 seconds now. But if we first have a deployed zookeeper cluster, and then change spec.probes.livenessProbe.initialDelaySeconds to 5 seconds, all other fields would have the correct default value.

Importance

(Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have)) Importance: should-have

Location

(Where is the piece of code, package, or document affected by this issue?) The default is set here: https://github.com/pravega/zookeeper-operator/blob/28d1f6917d2284c5673503816e110cf25555bd49/api/v1beta1/zookeepercluster_types.go#L565

Suggestions for an improvement

The default values should be set on per field basis, rather than only when the entire struct is nil, to avoid the inconsistency

(How do you suggest to fix or proceed with this issue?)