mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 08:58:11 +02:00
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>
This commit is contained in:
co-authored by
Felix Kunde
parent
bd2500da81
commit
a1bbfd9d9a
@@ -215,8 +215,8 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur
|
||||
result.LogicalBackupMemoryLimit = fromCRD.LogicalBackup.MemoryLimit
|
||||
|
||||
// debug config
|
||||
result.DebugLogging = fromCRD.OperatorDebug.DebugLogging
|
||||
result.EnableDBAccess = fromCRD.OperatorDebug.EnableDBAccess
|
||||
result.DebugLogging = *util.CoalesceBool(fromCRD.OperatorDebug.DebugLogging, util.True())
|
||||
result.EnableDBAccess = *util.CoalesceBool(fromCRD.OperatorDebug.EnableDBAccess, util.True())
|
||||
|
||||
// Teams API config
|
||||
result.EnableTeamsAPI = fromCRD.TeamsAPI.EnableTeamsAPI
|
||||
|
||||
Reference in New Issue
Block a user