From 6628cde426d4ee83961d1836e923539c8f83e46a Mon Sep 17 00:00:00 2001 From: Gabriele Bartolini Date: Fri, 8 Mar 2024 15:35:08 +0100 Subject: [PATCH] fix: unit tests for `wal_level` configuration (#4043) Fix a regression introduced by me at the last minute while changing a string in PR #4020. Signed-off-by: Gabriele Bartolini (cherry picked from commit dc70b353cf320da2c5f87a78cce5e55e4a9f22b8) --- api/v1/cluster_webhook.go | 2 +- api/v1/cluster_webhook_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1/cluster_webhook.go b/api/v1/cluster_webhook.go index f3b8fb57f4..b387f49665 100644 --- a/api/v1/cluster_webhook.go +++ b/api/v1/cluster_webhook.go @@ -1078,7 +1078,7 @@ func (r *Cluster) validateConfiguration() field.ErrorList { field.Invalid( field.NewPath("spec", "postgresql", "parameters", postgres.WalLevelParameter), walLevel, - fmt.Sprintf("unrecognized `wal_level` value -allowed values: `%s`, `%s`, `%s`", + fmt.Sprintf("unrecognized `wal_level` value - allowed values: `%s`, `%s`, `%s`", postgres.WalLevelValueLogical, postgres.WalLevelValueReplica, postgres.WalLevelValueMinimal, diff --git a/api/v1/cluster_webhook_test.go b/api/v1/cluster_webhook_test.go index 2c7a80df6b..70740405b4 100644 --- a/api/v1/cluster_webhook_test.go +++ b/api/v1/cluster_webhook_test.go @@ -1187,7 +1187,7 @@ var _ = Describe("configuration change validation", func() { errs := cluster.validateConfiguration() Expect(errs).To(HaveLen(1)) - Expect(errs[0].Detail).To(ContainSubstring("unknown wal_level value set")) + Expect(errs[0].Detail).To(ContainSubstring("unrecognized `wal_level` value - allowed values")) }) It("should reject minimal if it is a replica cluster", func() {