File tree Expand file tree Collapse file tree 7 files changed +138
-0
lines changed Expand file tree Collapse file tree 7 files changed +138
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : chainsaw.kyverno.io/v1alpha1
2+ kind : Test
3+ metadata :
4+ name : verify-postgis-extensions
5+ spec :
6+ timeouts :
7+ apply : 5s
8+ assert : 3m
9+ delete : 30s
10+ description : Verify all PostGIS related extensions are properly installed
11+ steps :
12+ - name : Create a Cluster with the extension
13+ try :
14+ - apply :
15+ file : cluster.yaml
16+ - apply :
17+ file : database.yaml
18+ - assert :
19+ file : cluster-assert.yaml
20+ - assert :
21+ file : database-assert.yaml
22+
23+ - name : Verify all extensions are installed
24+ try :
25+ - apply :
26+ file : check-extension.yaml
27+ - assert :
28+ file : check-extension-assert.yaml
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : extension-installed
5+ status :
6+ succeeded : 1
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : extension-installed
5+ spec :
6+ template :
7+ spec :
8+ restartPolicy : OnFailure
9+ containers :
10+ - name : data-test
11+ env :
12+ - name : DB_URI
13+ valueFrom :
14+ secretKeyRef :
15+ name : (join('-', [$values.name, 'app']))
16+ key : uri
17+ image : alpine/psql:latest
18+ command : ['sh', '-c']
19+ args :
20+ - |
21+ set -e
22+ DB_URI=$(echo $DB_URI | sed "s|/\*|/|")
23+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis')" -q)" = "t"
24+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_raster')" -q)" = "t"
25+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_sfcgal')" -q)" = "t"
26+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'fuzzystrmatch')" -q)" = "t"
27+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'address_standardizer')" -q)" = "t"
28+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'address_standardizer_data_us')" -q)" = "t"
29+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_tiger_geocoder')" -q)" = "t"
30+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_topology')" -q)" = "t"
31+ test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'pgrouting')" -q)" = "t"
Original file line number Diff line number Diff line change 1+ apiVersion : postgresql.cnpg.io/v1
2+ kind : Cluster
3+ metadata :
4+ name : ($values.name)
5+ status :
6+ readyInstances : 1
7+ phase : Cluster in healthy state
8+ image : ($values.pg_image)
Original file line number Diff line number Diff line change 1+ apiVersion : postgresql.cnpg.io/v1
2+ kind : Cluster
3+ metadata :
4+ name : ($values.name)
5+ spec :
6+ imageName : ($values.pg_image)
7+ instances : 1
8+
9+ storage :
10+ size : 1Gi
11+
12+ postgresql :
13+ shared_preload_libraries : ($values.shared_preload_libraries)
14+ extensions :
15+ - name : ($values.name)
16+ image :
17+ reference : ($values.extension_image)
18+ extension_control_path : ($values.extension_control_path)
19+ dynamic_library_path : ($values.dynamic_library_path)
20+ ld_library_path : ($values.ld_library_path)
Original file line number Diff line number Diff line change 1+ apiVersion : postgresql.cnpg.io/v1
2+ kind : Database
3+ metadata :
4+ name : (join('-', [$values.name, 'app']))
5+ status :
6+ applied : true
7+ extensions :
8+ - applied : true
9+ name : ($values.sql_name)
10+ - applied : true
11+ name : postgis_raster
12+ - applied : true
13+ name : postgis_sfcgal
14+ - applied : true
15+ name : fuzzystrmatch
16+ - applied : true
17+ name : address_standardizer
18+ - applied : true
19+ name : address_standardizer_data_us
20+ - applied : true
21+ name : postgis_tiger_geocoder
22+ - applied : true
23+ name : postgis_topology
24+ - applied : true
25+ name : pgrouting
26+ observedGeneration : 1
Original file line number Diff line number Diff line change 1+ apiVersion : postgresql.cnpg.io/v1
2+ kind : Database
3+ metadata :
4+ name : (join('-', [$values.name, 'app']))
5+ spec :
6+ name : app
7+ owner : app
8+ cluster :
9+ name : ($values.name)
10+ extensions :
11+ - name : ($values.sql_name)
12+ - name : postgis_raster
13+ - name : postgis_sfcgal
14+ - name : fuzzystrmatch
15+ - name : address_standardizer
16+ - name : address_standardizer_data_us
17+ - name : postgis_tiger_geocoder
18+ - name : postgis_topology
19+ - name : pgrouting
You can’t perform that action at this time.
0 commit comments