diff --git a/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml b/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml index 6aa20d266f9..60d05496c41 100644 --- a/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml +++ b/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml @@ -572,6 +572,55 @@ tests: - CREATE EXTENSION IF NOT EXISTS vectors; - CREATE EXTENSION IF NOT EXISTS some-extension; + - it: should pass with vectorchord + set: + postgresVectorchord16Image: + repository: docker.io/vectorchord/vectorchord + tag: "some-tag" + cnpg: + my-pg: + enabled: true + user: app + database: app + password: test-password + type: vectorchord + cluster: + initdb: + postInitApplicationSQL: + - CREATE EXTENSION IF NOT EXISTS some-extension; + postgresql: + key1: value1 + key2: '{{ printf "test-tpl" }}' + preloadLibraries: + - pg_stat_statements + - pg_cron + asserts: + - documentIndex: *clusterDoc + isKind: + of: Cluster + - documentIndex: *clusterDoc + isSubset: + path: spec + content: + postgresql: + parameters: + key1: value1 + key2: test-tpl + shared_preload_libraries: + - pg_stat_statements + - pg_cron + - vchord.so + bootstrap: + initdb: + secret: + name: test-release-name-common-test-cnpg-my-pg-user + database: app + owner: app + dataChecksums: true + postInitApplicationSQL: + - CREATE EXTENSION IF NOT EXISTS vchord CASCADE; + - CREATE EXTENSION IF NOT EXISTS some-extension; + - it: should pass with enabled monitoring set: postgresTimescaledb16Image: diff --git a/charts/library/common-test/tests/cnpg/cluster_validation_test.yaml b/charts/library/common-test/tests/cnpg/cluster_validation_test.yaml index 0b3981ec361..8b648777b88 100644 --- a/charts/library/common-test/tests/cnpg/cluster_validation_test.yaml +++ b/charts/library/common-test/tests/cnpg/cluster_validation_test.yaml @@ -88,7 +88,7 @@ tests: type: invalid asserts: - failedTemplate: - errorMessage: CNPG Cluster - Expected [type] to be one of [postgres, postgis, timescaledb, vectors], but got [invalid] + errorMessage: CNPG Cluster - Expected [type] to be one of [postgres, postgis, timescaledb, vectors, vectorchord], but got [invalid] - it: should fail with invalid log level set: diff --git a/charts/library/common/templates/class/cnpg/_cluster.tpl b/charts/library/common/templates/class/cnpg/_cluster.tpl index 2c3dfe27ad3..e6ebfea5476 100644 --- a/charts/library/common/templates/class/cnpg/_cluster.tpl +++ b/charts/library/common/templates/class/cnpg/_cluster.tpl @@ -123,6 +123,9 @@ {{- if eq $objectData.type "vectors" -}} {{- $preloadLibraries = mustAppend $preloadLibraries "vectors.so" -}} {{- end -}} + {{- if eq $objectData.type "vectorchord" -}} + {{- $preloadLibraries = mustAppend $preloadLibraries "vchord.so" -}} + {{- end -}} {{/* Storage */}} {{- with $objectData.cluster.storage.size -}} diff --git a/charts/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl b/charts/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl index 99eb2408a62..fef02716c95 100644 --- a/charts/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl +++ b/charts/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl @@ -33,6 +33,11 @@ "CREATE EXTENSION IF NOT EXISTS vectors;") -}} {{- end -}} + {{- if eq $objectData.type "vectorchord" -}} + {{- $postInitApplicationSQL = concat $postInitApplicationSQL (list + "CREATE EXTENSION IF NOT EXISTS vchord CASCADE;") -}} + {{- end -}} + {{- if $objectData.cluster.initdb -}} {{- $postInitApplicationSQL = concat $postInitApplicationSQL ( $objectData.cluster.initdb.postInitApplicationSQL | default list ) -}} {{- $postInitSQL = concat $postInitSQL ( $objectData.cluster.initdb.postInitSQL | default list ) -}} diff --git a/charts/library/common/templates/lib/cnpg/cluster/_validation.tpl b/charts/library/common/templates/lib/cnpg/cluster/_validation.tpl index b0ea878daac..eac1e3342dc 100644 --- a/charts/library/common/templates/lib/cnpg/cluster/_validation.tpl +++ b/charts/library/common/templates/lib/cnpg/cluster/_validation.tpl @@ -39,7 +39,7 @@ {{- end -}} {{- if (hasKey $objectData "type") -}} - {{- $validTypes := (list "postgres" "postgis" "timescaledb" "vectors") -}} + {{- $validTypes := (list "postgres" "postgis" "timescaledb" "vectors" "vectorchord") -}} {{- if not (mustHas $objectData.type $validTypes) -}} {{- fail (printf "CNPG Cluster - Expected [type] to be one of [%s], but got [%s]" (join ", " $validTypes) $objectData.type) -}} {{- end -}} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index 6dd6b367259..3bada8fdcfb 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -662,6 +662,16 @@ postgresVectors16Image: tag: "16.3-v0.2.1" pullPolicy: IfNotPresent +postgresVectorchord15Image: + repository: ghcr.io/tensorchord/cloudnative-vectorchord + tag: "15.14-0.5.3" + pullPolicy: IfNotPresent + +postgresVectorchord16Image: + repository: ghcr.io/tensorchord/cloudnative-vectorchord + tag: "16.10-0.5.3" + pullPolicy: IfNotPresent + # -- OpenVPN specific configuration # @default -- See below openvpnImage: @@ -1139,6 +1149,7 @@ cnpg: # * `postgis` # * `timescaledb` # * `vectors` + # * `vectorchord` type: postgres # Version of Postgresql to use, changes cluster naming scheme