()
| 289 | ) |
| 290 | |
| 291 | func (r *Cluster) setProbes() { |
| 292 | if r.Spec.Probes == nil { |
| 293 | r.Spec.Probes = &ProbesConfiguration{} |
| 294 | } |
| 295 | |
| 296 | if r.Spec.Probes.Liveness == nil { |
| 297 | r.Spec.Probes.Liveness = &LivenessProbe{} |
| 298 | } |
| 299 | |
| 300 | // we don't override the isolation check if it is already set |
| 301 | if r.Spec.Probes.Liveness.IsolationCheck != nil { |
| 302 | return |
| 303 | } |
| 304 | |
| 305 | // STEP 1: check if the alpha annotation is present, in that case convert it to spec |
| 306 | r.tryConvertAlphaLivenessPinger() |
| 307 | |
| 308 | if r.Spec.Probes.Liveness.IsolationCheck != nil { |
| 309 | return |
| 310 | } |
| 311 | |
| 312 | // STEP 2: set defaults. |
| 313 | r.Spec.Probes.Liveness.IsolationCheck = &IsolationCheckConfiguration{ |
| 314 | Enabled: ptr.To(true), |
| 315 | RequestTimeout: defaultRequestTimeout, |
| 316 | ConnectionTimeout: defaultConnectionTimeout, |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | func (r *Cluster) tryConvertAlphaLivenessPinger() { |
| 321 | if _, ok := r.Annotations[utils.LivenessPingerAnnotationName]; !ok { |
no test coverage detected