@@ -1561,6 +1561,38 @@ type ExtensionConfiguration struct {
15611561 // PostgreSQL process's `PATH` environment variable.
15621562 // +optional
15631563 BinPath []string `json:"bin_path,omitempty"`
1564+
1565+ // Env is a list of custom environment variables to be set in the
1566+ // PostgreSQL process for this extension. It is the responsibility of the
1567+ // cluster administrator to ensure the variables are correct for the
1568+ // specific extension. Note that changes to these variables require
1569+ // a manual cluster restart to take effect.
1570+ // +optional
1571+ // +listType=map
1572+ // +listMapKey=name
1573+ Env []ExtensionEnvVar `json:"env,omitempty"`
1574+ }
1575+
1576+ // ExtensionEnvVar defines an environment variable for a specific extension
1577+ // image volume.
1578+ type ExtensionEnvVar struct {
1579+ // Name of the environment variable to be injected into the
1580+ // PostgreSQL process.
1581+ // +kubebuilder:validation:MinLength=1
1582+ // +kubebuilder:validation:Pattern=`^[a-zA-Z_][a-zA-Z0-9_]*$`
1583+ Name string `json:"name"`
1584+
1585+ // Value of the environment variable. CloudNativePG performs a direct
1586+ // replacement of this value, with support for placeholder expansion.
1587+ // The ${`image_root`} placeholder resolves to the absolute mount path
1588+ // of the extension's volume (e.g., `/extensions/my-extension`). This
1589+ // is particularly useful for allowing applications or libraries to
1590+ // locate specific directories within the mounted image.
1591+ // Unrecognized placeholders are rejected. To include a literal ${...}
1592+ // in the value, escape it as $${...}.
1593+ //
1594+ // +kubebuilder:validation:MinLength=1
1595+ Value string `json:"value"`
15641596}
15651597
15661598// BootstrapConfiguration contains information about how to create the PostgreSQL
0 commit comments