Skip to content

Commit 658f19c

Browse files
authored
test(e2e): use official extension container images (cloudnative-pg#9328)
Closes cloudnative-pg#9327 Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 8c42229 commit 658f19c

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

.github/workflows/continuous-delivery.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ on:
2121
feature_type:
2222
description: >
2323
Feature Type (backup-restore, basic, cluster-metadata, declarative-databases, disruptive,
24-
importing-databases, maintenance, no-openshift, observability, operator, performance, plugin,
25-
pod-scheduling, postgres-configuration, postgres-major-upgrade, publication-subscription, recovery,
26-
replication, security, self-healing, service-connectivity, smoke, snapshot, storage, tablespaces, upgrade)
24+
image-volume-extensions, importing-databases, maintenance, no-openshift, observability, operator,
25+
performance, plugin, pod-scheduling, postgres-configuration, postgres-major-upgrade, publication-subscription,
26+
recovery, replication, security, self-healing, service-connectivity, smoke, snapshot, storage, tablespaces,
27+
upgrade)
2728
required: false
2829
log_level:
2930
description: 'Log level for operator (error, warning, info, debug(default), trace)'

contribute/e2e_testing_environment/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ exported, it will select all medium test cases from the feature type provided.
208208
| `publication-subscription` |
209209
| `declarative-databases` |
210210
| `postgres-major-upgrade` |
211+
| `image-volume-extensions` |
211212

212213
ex:
213214
```shell

docs/src/imagevolume_extensions.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ This feature allows you to mount a [PostgreSQL extension](https://www.postgresql
1616
packaged as an OCI-compliant container image, as a read-only and immutable
1717
volume inside a running pod at a known filesystem path.
1818

19-
You can make the extension available either globally, using the
20-
[`shared_preload_libraries` option](postgresql_conf.md#shared-preload-libraries),
21-
or at the database level through the `CREATE EXTENSION` command. For the
22-
latter, you can use the [`Database` resource’s declarative extension management](declarative_database_management.md/#managing-extensions-in-a-database)
23-
to ensure consistent, automated extension setup within your PostgreSQL
24-
databases.
19+
If the extension requires one or more shared libraries to be pre-loaded at server
20+
start, you can add them via the [`shared_preload_libraries` option](postgresql_conf.md#shared-preload-libraries).
21+
Also, if your extension requires being created at the database level through
22+
the `CREATE EXTENSION` command, you can use the [`Database` resource’s declarative extension management](declarative_database_management.md/#managing-extensions-in-a-database)
23+
to ensure consistent, automated extension setup within your PostgreSQL databases.
2524

2625
## Benefits
2726

@@ -295,7 +294,7 @@ spec:
295294
- name: postgis
296295
# ...
297296
ld_library_path:
298-
- syslib
297+
- system
299298
image:
300299
reference: # registry path for your PostGIS image
301300
# ...
@@ -304,7 +303,7 @@ spec:
304303
```
305304

306305
CloudNativePG will set the `LD_LIBRARY_PATH` environment variable to include
307-
`/extensions/postgis/syslib`, allowing PostgreSQL to locate and load these
306+
`/extensions/postgis/system`, allowing PostgreSQL to locate and load these
308307
system libraries at runtime.
309308

310309
!!! Important

tests/e2e/asserts_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,7 @@ func GetYAMLContent(sampleFilePath string) ([]byte, error) {
26432643
envVars := buildTemplateEnvs(map[string]string{
26442644
"E2E_PRE_ROLLING_UPDATE_IMG": preRollingUpdateImg,
26452645
"E2E_CSI_STORAGE_CLASS": csiStorageClass,
2646+
"PG_MAJOR": strconv.FormatUint(env.PostgresVersion, 10),
26462647
})
26472648

26482649
if serverName := os.Getenv("SERVER_NAME"); serverName != "" {

tests/e2e/fixtures/imagevolume_extensions/cluster-with-extensions.yaml.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ spec:
1818
extensions:
1919
- name: postgis
2020
ld_library_path:
21-
- syslib
21+
- system
2222
image:
23-
reference: ghcr.io/niccolofei/postgis:18rc1-master-trixie # wokeignore:rule=master
23+
reference: "ghcr.io/cloudnative-pg/postgis-extension:3.6.1-${PG_MAJOR}-trixie"
2424

2525
bootstrap:
2626
initdb:

tests/e2e/imagevolume_extensions_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SPDX-License-Identifier: Apache-2.0
2020
package e2e
2121

2222
import (
23+
"fmt"
2324
"path/filepath"
2425
"strings"
2526
"time"
@@ -40,7 +41,7 @@ import (
4041
. "github.com/onsi/gomega"
4142
)
4243

43-
var _ = Describe("ImageVolume Extensions", Label(tests.LabelPostgresConfiguration), func() {
44+
var _ = Describe("ImageVolume Extensions", Label(tests.LabelImageVolumeExtensions), func() {
4445
const (
4546
clusterManifest = fixturesDir + "/imagevolume_extensions/cluster-with-extensions.yaml.template"
4647
databaseManifest = fixturesDir + "/imagevolume_extensions/database.yaml.template"
@@ -197,7 +198,7 @@ var _ = Describe("ImageVolume Extensions", Label(tests.LabelPostgresConfiguratio
197198
apiv1.ExtensionConfiguration{
198199
Name: "pgvector",
199200
ImageVolumeSource: corev1.ImageVolumeSource{
200-
Reference: "ghcr.io/niccolofei/pgvector:18rc1-master-trixie", // wokeignore:rule=master
201+
Reference: fmt.Sprintf("ghcr.io/cloudnative-pg/pgvector:0.8.1-%d-trixie", env.PostgresVersion),
201202
},
202203
})
203204
// Setting some pgvector GUCs

tests/labels.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,7 @@ const (
100100

101101
// LabelPostgresMajorUpgrade is a label for Cluster major version upgrade tests
102102
LabelPostgresMajorUpgrade = "postgres-major-upgrade"
103+
104+
// LabelImageVolumeExtensions is a label for imageVolume extensions tests
105+
LabelImageVolumeExtensions = "image-volume-extensions"
103106
)

0 commit comments

Comments
 (0)