Skip to content

Conversation

@mbiagetti
Copy link
Contributor

@mbiagetti mbiagetti commented Jan 15, 2026

initial support for extensions dependencies

introduce a new field in the metadata spec to define a list of required extensions

supposing a metadata file like

metadata = {
  name                     = "pgrouting"
  sql_name                 = "pgrouting"
  image_name               = "pgrouting"
  shared_preload_libraries = []
  extension_control_path   = []
  dynamic_library_path     = []
  ld_library_path          = []
  auto_update_os_libs      = false
  required_extensions      = [
      "postgis",
  ]

  versions = {
    bookworm = {
      "18" = ":4.0.0+dfsg-1.pgdg12+1"
    }
    trixie = {
      "18" = "4.0.0+dfsg-1.pgdg13+1"
    }
  }
}

the command generate-testing-values command will generate the proper extensions like

dagger \
call \
-m ./dagger/maintenance/ \
generate-testing-values --target pgrouting --extension-image ghcr.io/cloudnative-pg/pgrouting:4.0.0-18-bookworm export --path=pgrouting/values.yaml
extensions:
    - dynamic_library_path: []
      extension_control_path: []
      image:
        reference: ghcr.io/cloudnative-pg/pgrouting:4.0.0-18-bookworm
      ld_library_path: []
      name: pgrouting
    - dynamic_library_path: []
      extension_control_path: []
      image:
        reference: ghcr.io/cloudnative-pg/postgis-extension:3.6.1-18-bookworm
      ld_library_path:
        - /system
      name: postgis
name: pgrouting
pg_image: ghcr.io/cloudnative-pg/postgresql:18-minimal-bookworm
sql_name: pgrouting
version: 4.0.0

closes #18

@mbiagetti mbiagetti force-pushed the mbiagetti/dev/18 branch 9 times, most recently from 85c3690 to 0c388d6 Compare January 19, 2026 14:15
@mbiagetti mbiagetti marked this pull request as ready for review January 22, 2026 13:57
@mbiagetti mbiagetti requested review from a team and NiccoloFei as code owners January 22, 2026 13:57
Signed-off-by: Niccolò Fei <[email protected]>
Copy link
Contributor

@GabriFedi97 GabriFedi97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we are not adding all the extensions defined as dependencies when we create the Database CR in the automated tests. CNPG doesn't create the extensions with the CASCADE option so all the required extensions need to be explicitly created beforehand.

Co-authored-by: Gabriele Fedi <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
@NiccoloFei
Copy link
Contributor

I see we are not adding all the extensions defined as dependencies when we create the Database CR in the automated tests. CNPG doesn't create the extensions with the CASCADE option so all the required extensions need to be explicitly created beforehand.

This will be added as part of #92, given that in #92 we are adding an adhoc field in the values.yaml to customize the spec.extensions section of a Database.

@mnencia mnencia merged commit 18ccd88 into cloudnative-pg:main Feb 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define dependencies among extensions

4 participants