From cfcd3292814c6147cdbc5645f4bbbc7964e5b946 Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Tue, 8 Oct 2024 15:23:00 -0600 Subject: [PATCH] tests --- internal/fullnode/pod_builder_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/internal/fullnode/pod_builder_test.go b/internal/fullnode/pod_builder_test.go index 8ceb7cc4..ad5c84cb 100644 --- a/internal/fullnode/pod_builder_test.go +++ b/internal/fullnode/pod_builder_test.go @@ -548,6 +548,25 @@ gaiad start --home /home/operator/cosmos` sidecar := pod.Spec.Containers[1] require.Equal(t, "healthcheck", sidecar.Name) require.Nil(t, sidecar.ReadinessProbe) + + crd.Spec.PodTemplate.Probes = cosmosv1.FullNodeProbesSpec{Strategy: cosmosv1.FullNodeProbeStrategyReachable} + + builder = NewPodBuilder(&crd) + pod, err = builder.WithOrdinal(1).Build() + require.NoError(t, err) + + require.NotNilf(t, pod.Spec.Containers[0].ReadinessProbe, "container 0") + require.Nilf(t, pod.Spec.Containers[1].ReadinessProbe, "container 1") + + crd.Spec.PodTemplate.Probes = cosmosv1.FullNodeProbesSpec{Strategy: cosmosv1.FullNodeProbeStrategyInSync} + + builder = NewPodBuilder(&crd) + pod, err = builder.WithOrdinal(1).Build() + require.NoError(t, err) + + require.NotNilf(t, pod.Spec.Containers[0].ReadinessProbe, "container 0") + require.NotNilf(t, pod.Spec.Containers[1].ReadinessProbe, "container 1") + }) t.Run("strategic merge fields", func(t *testing.T) {