Skip to content

Commit

Permalink
Merge pull request #56 from cybertec-postgresql/fixICU
Browse files Browse the repository at this point in the history
fix using icu for pg15 or newer only
  • Loading branch information
Schmaetz authored Aug 15, 2024
2 parents 82b71c2 + f1601c2 commit 24a326c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions pkg/cluster/k8sres.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,23 @@ func generateSpiloJSONConfiguration(pg *cpov1.PostgresqlParam, patroni *cpov1.Pa

config.Bootstrap = pgBootstrap{}

config.Bootstrap.Initdb = []interface{}{map[string]string{"auth-host": "scram-sha-256"},
map[string]string{"auth-local": "trust"},
map[string]string{"encoding": "UTF8"},
map[string]string{"locale": "en_US.UTF-8"},
map[string]string{"locale-provider": "icu"},
map[string]string{"icu-locale": "en_US"}}
pgVersion, err := strconv.Atoi(pg.PgVersion)
if err != nil {
fmt.Println("Problem to get PGVersion:", err)
pgVersion = 16
}
if pgVersion > 14 {
config.Bootstrap.Initdb = []interface{}{map[string]string{"auth-host": "scram-sha-256"},
map[string]string{"auth-local": "trust"},
map[string]string{"encoding": "UTF8"},
map[string]string{"locale": "en_US.UTF-8"},
map[string]string{"locale-provider": "icu"},
map[string]string{"icu-locale": "en_US"}}
} else {
config.Bootstrap.Initdb = []interface{}{map[string]string{"auth-host": "scram-sha-256"},
map[string]string{"auth-local": "trust"}}
}

if enableTDE {
config.Bootstrap.Initdb = append(config.Bootstrap.Initdb, map[string]string{"encryption-key-command": "/scripts/pgee/tde.sh"})
}
Expand Down

0 comments on commit 24a326c

Please sign in to comment.