Skip to content

Commit

Permalink
fix: unit tests for wal_level configuration (cloudnative-pg#4043)
Browse files Browse the repository at this point in the history
Fix a regression introduced by me at the last minute while changing a
string in PR cloudnative-pg#4020.

Signed-off-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit dc70b35)
  • Loading branch information
gbartolini committed Mar 8, 2024
1 parent ff755e0 commit 6628cde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v1/cluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion api/v1/cluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 6628cde

Please sign in to comment.