Repository: cloudnative-pg/cloudnative-pg

Issue:
[Test]: Use official extension container images in the E2Es
### Is there an existing issue already for this bug?

- [x] I have searched for an existing issue, and could not find anything. I believe this is a new bug.

### I have read the troubleshooting guide

- [x] I have read the troubleshooting guide and I think this is a new bug.

### I am running a supported version of CloudNativePG

- [x] I have read the troubleshooting guide and I think this is a new bug.

### Contact Details

_No response_

### Version

trunk (main)

### What version of Kubernetes are you using?

1.34

### What is your Kubernetes environment?

Self-managed: kind (evaluation)

### How did you install the operator?

YAML manifest

### What happened?

In the E2Es tests, we were temporarily using 2 container image extensions that were being hosted in my personal project's registry.
Now that we have official images from https://github.com/cloudnative-pg/postgres-extensions-containers, we should switch to using those.

### Cluster resource

```shell

```

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Hints from issue comments:
@dosubot: <!-- Answer -->
You’re right—the E2E tests are currently referencing extension images from a personal registry in two places: the PostGIS extension in the YAML fixture (`cluster-with-extensions.yaml.template`) and the pgvector extension in the Go test file (`imagevolume_extensions_test.go`). Both use images like `ghcr.io/niccolofei/postgis:18rc1-master-trixie` and `ghcr.io/niccolofei/pgvector:18rc1-master-trixie`[source](https://github.com/cloudnative-pg/cloudnative-pg/blob/a0eebc8079ae19b619f43e811f062243af665815/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template#L18-L24)[source](https://github.com/cloudnative-pg/cloudnative-pg/blob/a0eebc8079ae19b619f43e811f062243af665815/tests/e2e/imagevolume_extensions_test.go#L75-L229).

To switch to the official images, update those references to use the official GHCR images published by the CloudNativePG project. For example, use `ghcr.io/cloudnative-pg/postgis:18-3.6-system-trixie` for PostGIS and the corresponding `ghcr.io/cloudnative-pg/pgvector:<tag>` for pgvector, following the naming conventions described in the [postgres-extensions-containers repo](https://github.com/cloudnative-pg/postgres-extensions-containers) and related discussions[source](https://github.com/cloudnative-pg/cloudnative-pg/discussions/8577)[source](https://github.com/cloudnative-pg/cloudnative-pg/discussions/7073).

No special configuration (like imagePullSecrets) is typically needed for public GHCR images in a kind-based test environment, but if your cluster restricts image pulls, you may need to adjust accordingly.

The official extension images are maintained with clear governance, versioning, and are smoke-tested on Kind as part of CI, so they’re suitable for both production and test use[source](https://github.com/cloudnative-pg/cloudnative-pg/discussions/8577).

Once you update both the YAML fixture and the inline test code to use the official image references, your E2E suite will be aligned with the released extension images.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ed1bfcde-8704-4318-9b6d-14ff16d6cc34?feedback_type=other)</sup>

[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/89b818f3-8b5e-449b-bfb3-64a9360d9665/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%E2%80%99re%20right%E2%80%94the%20E2E%20tests%20are%20currently%20referencing%20extension%20images%20from%20a%20personal%20registry%20in%20two%20places%3A%20the%20PostGIS%20extension%20in%20the%20YAML%20fixture%20%28%60cluster-with-extensions.yaml.template%60%29%20and%20the%20pgvector%20extension%20in%20the%20Go%20test%20file%20%28%60imagevolume_extensions_test.go%60%29.%20Both%20use%20images%20like%20%60ghcr.io/niccolofei/postgis%3A18rc1-master-trixie%60%20and%20%60ghcr.io/niccolofei/pgvector%3A18rc1-master-trixie%60%5Bsource%5D%28https%3A//github.com/cloudnative-pg/cloudnative-pg/blob/a0eebc8079ae19b619f43e811f062243af665815/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template%23L18-L24%29%5Bsource%5D%28https%3A//github.com/cloudnative-pg/cloudnative-pg/blob/a0eebc8079ae19b619f43e811f062243af665815/tests/e2e/imagevolume_extensions_test.go%23L75-L229%29.%0A%0ATo%20switch%20to%20the%20official%20images%2C%20update%20those%20references%20to%20use%20the%20official%20GHCR%20images%20published%20by%20the%20CloudNativePG%20project.%20For%20example%2C%20use%20%60ghcr.io/cloudnative-pg/postgis%3A18-3.6-system-trixie%60%20for%20PostGIS%20and%20the%20corresponding%20%60ghcr.io/cloudnative-pg/pgvector%3A%3Ctag%3E%60%20for%20pgvector%2C%20following%20the%20naming%20conventions%20described%20in%20the%20%5Bpostgres-extensions-containers%20repo%5D%28https%3A//github.com/cloudnative-pg/postgres-extensions-containers%29%20and%20related%20discussions%5Bsource%5D%28https%3A//github.com/cloudnative-pg/cloudnative-pg/discussions/8577%29%5Bsource%5D%28https%3A//github.com/cloudnative-pg/cloudnative-pg/discussions/7073%29.%0A%0ANo%20special%20configuration%20%28like%20imagePullSecrets%29%20is%20typically%20needed%20for%20public%20GHCR%20images%20in%20a%20kind-based%20test%20environment%2C%20but%20if%20your%20cluster%20restricts%20image%20pulls%2C%20you%20may%20need%20to%20adjust%20accordingly.%0A%0AThe%20official%20extension%20images%20are%20maintained%20with%20clear%20governance%2C%20versioning%2C%20and%20are%20smoke-tested%20on%20Kind%20as%20part%20of%20CI%2C%20so%20they%E2%80%99re%20suitable%20for%20both%20production%20and%20test%20use%5Bsource%5D%28https%3A//github.com/cloudnative-pg/cloudnative-pg/discussions/8577%29.%0A%0AOnce%20you%20update%20both%20the%20YAML%20fixture%20and%20the%20inline%20test%20code%20to%20use%20the%20official%20image%20references%2C%20your%20E2E%20suite%20will%20be%20aligned%20with%20the%20released%20extension%20images.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/cloudnative-pg/cloudnative-pg/issues/9327)@gbartolini: This is cool @NiccoloFei!

Solution patch:
diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml
index 3a7ebd9e..28f3ec99 100644
--- a/.github/workflows/continuous-delivery.yml
+++ b/.github/workflows/continuous-delivery.yml
@@ -21,9 +21,10 @@ on:
       feature_type:
         description: >
           Feature Type (backup-restore, basic, cluster-metadata, declarative-databases, disruptive,
-          importing-databases, maintenance, no-openshift, observability, operator, performance, plugin,
-          pod-scheduling, postgres-configuration, postgres-major-upgrade, publication-subscription, recovery,
-          replication, security, self-healing, service-connectivity, smoke, snapshot, storage, tablespaces, upgrade)
+          image-volume-extensions, importing-databases, maintenance, no-openshift, observability, operator,
+          performance, plugin, pod-scheduling, postgres-configuration, postgres-major-upgrade, publication-subscription,
+          recovery, replication, security, self-healing, service-connectivity, smoke, snapshot, storage, tablespaces,
+          upgrade)
         required: false
       log_level:
         description: 'Log level for operator (error, warning, info, debug(default), trace)'
diff --git a/contribute/e2e_testing_environment/README.md b/contribute/e2e_testing_environment/README.md
index 64979451..69e5241f 100644
--- a/contribute/e2e_testing_environment/README.md
+++ b/contribute/e2e_testing_environment/README.md
@@ -208,6 +208,7 @@ exported, it will select all medium test cases from the feature type provided.
 | `publication-subscription`        |
 | `declarative-databases`           |
 | `postgres-major-upgrade`          |
+| `image-volume-extensions`         |
 
 ex:
 ```shell
diff --git a/docs/src/imagevolume_extensions.md b/docs/src/imagevolume_extensions.md
index 91920a6f..bd6ac5c1 100644
--- a/docs/src/imagevolume_extensions.md
+++ b/docs/src/imagevolume_extensions.md
@@ -16,12 +16,11 @@ This feature allows you to mount a [PostgreSQL extension](https://www.postgresql
 packaged as an OCI-compliant container image, as a read-only and immutable
 volume inside a running pod at a known filesystem path.
 
-You can make the extension available either globally, using the
-[`shared_preload_libraries` option](postgresql_conf.md#shared-preload-libraries),
-or at the database level through the `CREATE EXTENSION` command. For the
-latter, you can use the [`Database` resource’s declarative extension management](declarative_database_management.md/#managing-extensions-in-a-database)
-to ensure consistent, automated extension setup within your PostgreSQL
-databases.
+If the extension requires one or more shared libraries to be pre-loaded at server
+start, you can add them via the [`shared_preload_libraries` option](postgresql_conf.md#shared-preload-libraries).
+Also, if your extension requires being created at the database level through
+the `CREATE EXTENSION` command, you can use the [`Database` resource’s declarative extension management](declarative_database_management.md/#managing-extensions-in-a-database)
+to ensure consistent, automated extension setup within your PostgreSQL databases.
 
 ## Benefits
 
@@ -295,7 +294,7 @@ spec:
       - name: postgis
         # ...
         ld_library_path:
-          - syslib
+          - system
         image:
           reference: # registry path for your PostGIS image
       # ...
@@ -304,7 +303,7 @@ spec:
 ```
 
 CloudNativePG will set the `LD_LIBRARY_PATH` environment variable to include
-`/extensions/postgis/syslib`, allowing PostgreSQL to locate and load these
+`/extensions/postgis/system`, allowing PostgreSQL to locate and load these
 system libraries at runtime.
 
 !!! Important



Test patch:
diff --git a/tests/e2e/asserts_test.go b/tests/e2e/asserts_test.go
index 4b61ce03..9b487856 100644
--- a/tests/e2e/asserts_test.go
+++ b/tests/e2e/asserts_test.go
@@ -2643,6 +2643,7 @@ func GetYAMLContent(sampleFilePath string) ([]byte, error) {
 		envVars := buildTemplateEnvs(map[string]string{
 			"E2E_PRE_ROLLING_UPDATE_IMG": preRollingUpdateImg,
 			"E2E_CSI_STORAGE_CLASS":      csiStorageClass,
+			"PG_MAJOR":                   strconv.FormatUint(env.PostgresVersion, 10),
 		})
 
 		if serverName := os.Getenv("SERVER_NAME"); serverName != "" {
diff --git a/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template b/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template
index e04f3230..f8de43b3 100644
--- a/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template
+++ b/tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template
@@ -18,9 +18,9 @@ spec:
     extensions:
       - name: postgis
         ld_library_path:
-          - syslib
+          - system
         image:
-          reference: ghcr.io/niccolofei/postgis:18rc1-master-trixie # wokeignore:rule=master
+          reference: "ghcr.io/cloudnative-pg/postgis-extension:3.6.1-${PG_MAJOR}-trixie"
 
   bootstrap:
     initdb:
diff --git a/tests/e2e/imagevolume_extensions_test.go b/tests/e2e/imagevolume_extensions_test.go
index 54fa0f3a..6a36b2ad 100644
--- a/tests/e2e/imagevolume_extensions_test.go
+++ b/tests/e2e/imagevolume_extensions_test.go
@@ -20,6 +20,7 @@ SPDX-License-Identifier: Apache-2.0
 package e2e
 
 import (
+	"fmt"
 	"path/filepath"
 	"strings"
 	"time"
@@ -40,7 +41,7 @@ import (
 	. "github.com/onsi/gomega"
 )
 
-var _ = Describe("ImageVolume Extensions", Label(tests.LabelPostgresConfiguration), func() {
+var _ = Describe("ImageVolume Extensions", Label(tests.LabelImageVolumeExtensions), func() {
 	const (
 		clusterManifest  = fixturesDir + "/imagevolume_extensions/cluster-with-extensions.yaml.template"
 		databaseManifest = fixturesDir + "/imagevolume_extensions/database.yaml.template"
@@ -197,7 +198,7 @@ var _ = Describe("ImageVolume Extensions", Label(tests.LabelPostgresConfiguratio
 					apiv1.ExtensionConfiguration{
 						Name: "pgvector",
 						ImageVolumeSource: corev1.ImageVolumeSource{
-							Reference: "ghcr.io/niccolofei/pgvector:18rc1-master-trixie", // wokeignore:rule=master
+							Reference: fmt.Sprintf("ghcr.io/cloudnative-pg/pgvector:0.8.1-%d-trixie", env.PostgresVersion),
 						},
 					})
 				// Setting some pgvector GUCs
diff --git a/tests/labels.go b/tests/labels.go
index 15d5461f..ead4ee09 100644
--- a/tests/labels.go
+++ b/tests/labels.go
@@ -100,4 +100,7 @@ const (
 
 	// LabelPostgresMajorUpgrade is a label for Cluster major version upgrade tests
 	LabelPostgresMajorUpgrade = "postgres-major-upgrade"
+
+	// LabelImageVolumeExtensions is a label for imageVolume extensions tests
+	LabelImageVolumeExtensions = "image-volume-extensions"
 )