postgres-operator/pkg/apis/acid.zalan.do/v1
Raphael Torquato a1bbfd9d9a
Fix bool config defaults when using OperatorConfiguration CRD (#3084)
* Fix bool config defaults when using OperatorConfiguration CRD

When using OperatorConfiguration CRD, boolean fields with default value
of `true` (like `enable_database_access` and `debug_logging`) were
incorrectly defaulting to `false` when not explicitly specified.

This happened because Go initializes bool fields to `false`, and there
was no coalesce logic to apply the intended defaults.

The fix changes the CRD type fields from `bool` to `*bool` (pointer),
allowing us to distinguish between "not specified" (nil) and "explicitly
set to false". Then we use the existing `CoalesceBool` utility function
to apply the correct defaults.

Fixes #2575

* update generated code

Updated DeepCopyInto method for OperatorDebugConfiguration to handle pointers for DebugLogging and EnableDBAccess.

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-03 13:00:51 +02:00
..
const.go add unit test and documentation for finalizers (#2509) 2024-01-22 12:13:40 +01:00
crds.go Provide liveness probe for CRD and config (#3089) 2026-06-02 17:31:42 +02:00
doc.go Fix golint failures 2019-01-08 13:04:48 +01:00
marshal.go add support for global maintenance windows (#3038) 2026-01-30 11:37:21 +01:00
operator_configuration_type.go Fix bool config defaults when using OperatorConfiguration CRD (#3084) 2026-06-03 13:00:51 +02:00
postgres_team_type.go Generate CRD for postgresteam resource (#3004) 2026-01-10 19:39:08 +01:00
postgresql.crd.yaml Provide liveness probe for CRD and config (#3089) 2026-06-02 17:31:42 +02:00
postgresql_type.go Provide liveness probe for CRD and config (#3089) 2026-06-02 17:31:42 +02:00
register.go PostgresTeam CRD for advanced team management (#1165) 2020-10-28 10:40:10 +01:00
util.go Make teamId in cluster name optional (#2001) 2022-08-24 10:12:50 +02:00
util_test.go Add support for pg18 and remove pg13 (#3035) 2026-02-17 10:19:19 +01:00
zz_generated.deepcopy.go Fix bool config defaults when using OperatorConfiguration CRD (#3084) 2026-06-03 13:00:51 +02:00