diff --git a/internal/locality/locality.go b/internal/locality/locality.go index d2c33937b..0fdba7c57 100644 --- a/internal/locality/locality.go +++ b/internal/locality/locality.go @@ -364,9 +364,10 @@ func CheckCoordinatorValidity(logger logr.Logger, cluster *fdbv1beta2.Foundation continue } + mixedTls := cluster.Status.Generations.HasExtraListeners == cluster.Generation var ipAddress fdbv1beta2.ProcessAddress for _, addr := range addresses { - if addr.Flags["tls"] == cluster.Spec.MainContainer.EnableTLS { + if mixedTls || (addr.Flags["tls"] == cluster.Spec.MainContainer.EnableTLS) { ipAddress = addr break } diff --git a/internal/locality/locality_test.go b/internal/locality/locality_test.go index c73b2731f..5bebaf803 100644 --- a/internal/locality/locality_test.go +++ b/internal/locality/locality_test.go @@ -1171,6 +1171,7 @@ var _ = Describe("Localities", func() { } status = generateDefaultStatus(false) + cluster.Status.Generations.HasExtraListeners = -1 }) JustBeforeEach(func() { @@ -1243,7 +1244,21 @@ var _ = Describe("Localities", func() { }) }) - When("the coordinators are listening on TLS", func() { + When("the coordinators are listening on TLS, and this generation is noted HasExtraListeners", func() { + BeforeEach(func() { + cluster.Spec.MainContainer.EnableTLS = true + cluster.Status.Generations.HasExtraListeners = cluster.Generation + }) + + It("should report the coordinators as valid", func() { + coordinatorsValid, addressesValid, err := CheckCoordinatorValidity(logr.Discard(), cluster, status, coordinatorStatus) + Expect(coordinatorsValid).To(BeTrue()) + Expect(addressesValid).To(BeTrue()) + Expect(err).NotTo(HaveOccurred()) + }) + }) + + When("the coordinators are listening on TLS, HasExtraListeners not set", func() { BeforeEach(func() { cluster.Spec.MainContainer.EnableTLS = true })