From 5a7d305fcaff0cbb4bb9837602cd189ce8990e2a Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:55:47 +0100 Subject: [PATCH] [Feature] 3.10 Rotation Prevention (#1499) --- pkg/deployment/rotation/arangod_containers.go | 4 ++++ pkg/deployment/rotation/arangod_probes.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pkg/deployment/rotation/arangod_containers.go b/pkg/deployment/rotation/arangod_containers.go index 7d04f6031..4457bba5e 100644 --- a/pkg/deployment/rotation/arangod_containers.go +++ b/pkg/deployment/rotation/arangod_containers.go @@ -258,6 +258,10 @@ func areProbesEqual(a, b *core.Probe) bool { } func isManagedProbe(a, b *core.Probe) bool { + if a == nil || b == nil { + return false + } + if a.Exec == nil || b.Exec == nil { return false } diff --git a/pkg/deployment/rotation/arangod_probes.go b/pkg/deployment/rotation/arangod_probes.go index db27dddc2..bcdab90cb 100644 --- a/pkg/deployment/rotation/arangod_probes.go +++ b/pkg/deployment/rotation/arangod_probes.go @@ -50,6 +50,11 @@ func compareServerContainerProbes(ds api.DeploymentSpec, g api.ServerGroup, spec if !areProbesEqual(spec.LivenessProbe, status.LivenessProbe) { if isManagedProbe(spec.LivenessProbe, status.LivenessProbe) { + if spec.LivenessProbe.FailureThreshold != status.LivenessProbe.FailureThreshold { + status.LivenessProbe.FailureThreshold = spec.LivenessProbe.FailureThreshold + mode = mode.And(compare.SilentRotation) + } + q := status.LivenessProbe.DeepCopy() q.Exec = spec.LivenessProbe.Exec.DeepCopy()