mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-04 22:02:35 +02:00
define more default values for opConfig CRD (#955)
This commit is contained in:
@@ -83,7 +83,7 @@ type LogicalBackup struct {
|
||||
LogicalBackupS3Endpoint string `name:"logical_backup_s3_endpoint" default:""`
|
||||
LogicalBackupS3AccessKeyID string `name:"logical_backup_s3_access_key_id" default:""`
|
||||
LogicalBackupS3SecretAccessKey string `name:"logical_backup_s3_secret_access_key" default:""`
|
||||
LogicalBackupS3SSE string `name:"logical_backup_s3_sse" default:"AES256"`
|
||||
LogicalBackupS3SSE string `name:"logical_backup_s3_sse" default:""`
|
||||
}
|
||||
|
||||
// Operator options for connection pooler
|
||||
|
||||
+11
-3
@@ -147,7 +147,7 @@ func Coalesce(val, defaultVal string) string {
|
||||
return val
|
||||
}
|
||||
|
||||
// Yeah, golang
|
||||
// CoalesceInt32 works like coalesce but for *int32
|
||||
func CoalesceInt32(val, defaultVal *int32) *int32 {
|
||||
if val == nil {
|
||||
return defaultVal
|
||||
@@ -155,6 +155,14 @@ func CoalesceInt32(val, defaultVal *int32) *int32 {
|
||||
return val
|
||||
}
|
||||
|
||||
// CoalesceBool works like coalesce but for *bool
|
||||
func CoalesceBool(val, defaultVal *bool) *bool {
|
||||
if val == nil {
|
||||
return defaultVal
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// Test if any of the values is nil
|
||||
func testNil(values ...*int32) bool {
|
||||
for _, v := range values {
|
||||
@@ -166,8 +174,8 @@ func testNil(values ...*int32) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Return maximum of two integers provided via pointers. If one value is not
|
||||
// defined, return the other one. If both are not defined, result is also
|
||||
// MaxInt32 : Return maximum of two integers provided via pointers. If one value
|
||||
// is not defined, return the other one. If both are not defined, result is also
|
||||
// undefined, caller needs to check for that.
|
||||
func MaxInt32(a, b *int32) *int32 {
|
||||
if testNil(a, b) {
|
||||
|
||||
Reference in New Issue
Block a user