Skip to content

Commit 659fa40

Browse files
GabriFedi97NiccoloFei
authored andcommitted
feat: postgres parameters in extension metadata
Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
1 parent 445aa6e commit 659fa40

File tree

10 files changed

+29
-13
lines changed

10 files changed

+29
-13
lines changed

dagger/maintenance/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func (m *Maintenance) GenerateTestingValues(
204204
Name: metadata.Name,
205205
SQLName: metadata.SQLName,
206206
SharedPreloadLibraries: metadata.SharedPreloadLibraries,
207+
PostgresqlParameters: metadata.PostgresqlParameters,
207208
PgImage: pgImage,
208209
Version: version,
209210
CreateExtension: metadata.CreateExtension,

dagger/maintenance/parse.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ type extensionVersion struct {
2525
type versionMap map[string]map[string]extensionVersion
2626

2727
type extensionMetadata struct {
28-
Name string `hcl:"name" cty:"name"`
29-
SQLName string `hcl:"sql_name" cty:"sql_name"`
30-
ImageName string `hcl:"image_name" cty:"image_name"`
31-
SharedPreloadLibraries []string `hcl:"shared_preload_libraries" cty:"shared_preload_libraries"`
32-
ExtensionControlPath []string `hcl:"extension_control_path" cty:"extension_control_path"`
33-
DynamicLibraryPath []string `hcl:"dynamic_library_path" cty:"dynamic_library_path"`
34-
LdLibraryPath []string `hcl:"ld_library_path" cty:"ld_library_path"`
35-
BinPath []string `hcl:"bin_path" cty:"bin_path"`
36-
AutoUpdateOsLibs bool `hcl:"auto_update_os_libs" cty:"auto_update_os_libs"`
37-
RequiredExtensions []string `hcl:"required_extensions" cty:"required_extensions"`
38-
CreateExtension bool `hcl:"create_extension" cty:"create_extension"`
39-
Versions versionMap `hcl:"versions" cty:"versions"`
40-
Remain hcl.Body `hcl:",remain"`
28+
Name string `hcl:"name" cty:"name"`
29+
SQLName string `hcl:"sql_name" cty:"sql_name"`
30+
ImageName string `hcl:"image_name" cty:"image_name"`
31+
SharedPreloadLibraries []string `hcl:"shared_preload_libraries" cty:"shared_preload_libraries"`
32+
PostgresqlParameters map[string]string `hcl:"postgresql_parameters" cty:"postgresql_parameters"`
33+
ExtensionControlPath []string `hcl:"extension_control_path" cty:"extension_control_path"`
34+
DynamicLibraryPath []string `hcl:"dynamic_library_path" cty:"dynamic_library_path"`
35+
LdLibraryPath []string `hcl:"ld_library_path" cty:"ld_library_path"`
36+
BinPath []string `hcl:"bin_path" cty:"bin_path"`
37+
AutoUpdateOsLibs bool `hcl:"auto_update_os_libs" cty:"auto_update_os_libs"`
38+
RequiredExtensions []string `hcl:"required_extensions" cty:"required_extensions"`
39+
CreateExtension bool `hcl:"create_extension" cty:"create_extension"`
40+
Versions versionMap `hcl:"versions" cty:"versions"`
41+
Remain hcl.Body `hcl:",remain"`
4142
}
4243

4344
const (

dagger/maintenance/testingvalues.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type TestingValues struct {
2121
Name string `yaml:"name"`
2222
SQLName string `yaml:"sql_name"`
2323
SharedPreloadLibraries []string `yaml:"shared_preload_libraries"`
24+
PostgresqlParameters map[string]string `yaml:"postgresql_parameters"`
2425
PgImage string `yaml:"pg_image"`
2526
Version string `yaml:"version"`
2627
CreateExtension bool `yaml:"create_extension"`

pg-crash/metadata.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata = {
66
image_name = "pg-crash"
77
licenses = ["BSD-3-Clause"]
88
shared_preload_libraries = ["pg_crash"]
9+
postgresql_parameters = {}
910
extension_control_path = []
1011
dynamic_library_path = []
1112
ld_library_path = []

pgaudit/metadata.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata = {
44
image_name = "pgaudit"
55
licenses = ["PostgreSQL"]
66
shared_preload_libraries = ["pgaudit"]
7+
postgresql_parameters = {}
78
extension_control_path = []
89
dynamic_library_path = []
910
ld_library_path = []

pgvector/metadata.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata = {
44
image_name = "pgvector"
55
licenses = ["PostgreSQL"]
66
shared_preload_libraries = []
7+
postgresql_parameters = {}
78
extension_control_path = []
89
dynamic_library_path = []
910
ld_library_path = []

postgis/metadata.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata = {
55
licenses = [ "GPL-2.0-or-later", "MIT", "LGPL-2.1-or-later",
66
"GPL-3.0-or-later", "Apache-2.0", "PostgreSQL", "Zlib" ]
77
shared_preload_libraries = []
8+
postgresql_parameters = {}
89
extension_control_path = []
910
dynamic_library_path = []
1011
ld_library_path = ["system"]

postgis/test/cluster.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ spec:
1010
size: 1Gi
1111

1212
postgresql:
13+
parameters: ($values.postgresql_parameters)
1314
shared_preload_libraries: ($values.shared_preload_libraries)
1415
extensions: ($values.extensions)

templates/metadata.hcl.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ metadata = {
2727
# Example: ["pgaudit"].
2828
shared_preload_libraries = []
2929

30+
# TODO: Remove this comment block after customizing the file.
31+
# `postgresql_parameters`: custom PostgreSQL configuration parameters to be set
32+
# for this extension. Usually empty.
33+
# Used in tests.
34+
# Example: { "pgaudit.log_client" = "on" }.
35+
postgresql_parameters = {}
36+
3037
# TODO: Remove this comment block after customizing the file.
3138
# `extension_control_path`: if EMPTY (`[]`), the operator follows the CNPG
3239
# convention and will add the image's `share` directory to

test/cluster.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ spec:
1010
size: 1Gi
1111

1212
postgresql:
13+
parameters: ($values.postgresql_parameters)
1314
shared_preload_libraries: ($values.shared_preload_libraries)
1415
extensions: ($values.extensions)

0 commit comments

Comments
 (0)