postgres-operator/pkg/controller
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
..
controller.go refactor(controller): use kubernetes informers provided by client-go (#3080) 2026-06-03 12:43:34 +02:00
logs_and_api.go deprecate ClusterName field of Postgresql type and remove team from REST endpoints (#2015) 2022-08-29 15:00:25 +02:00
node.go refactor(controller): use kubernetes informers provided by client-go (#3080) 2026-06-03 12:43:34 +02:00
node_test.go diff SecurityContext of containers (#1255) 2020-12-15 10:06:53 +01:00
operator_config.go Fix bool config defaults when using OperatorConfiguration CRD (#3084) 2026-06-03 13:00:51 +02:00
pod.go refactor(controller): use kubernetes informers provided by client-go (#3080) 2026-06-03 12:43:34 +02:00
postgresql.go Fix deletion timestamp handling for clusters with finalizers (#3015) 2026-06-01 09:18:20 +02:00
postgresql_test.go allow delete only if annotations meet configured criteria (#1069) 2020-08-13 16:36:22 +02:00
types.go Bootstrapped databases with best practice role setup (#843) 2020-04-29 10:56:06 +02:00
util.go Fix serving CRD at runtime (#3031) 2026-01-13 17:23:56 +01:00
util_test.go reflect linter feedback, remove unused argumnents and redundant type from arrays (#2739) 2024-08-27 17:56:07 +02:00