From 60640a3539e60245198aa4b34af265062f082827 Mon Sep 17 00:00:00 2001 From: Josh Wells Date: Mon, 1 Sep 2025 17:55:59 +0100 Subject: [PATCH] Added support for postgres 17 --- .github/workflows/pr-postgres-tests.yml | 1 + CHANGELOG.md | 2 ++ builders/postgres.js | 3 +- docs/config.md | 8 ++--- docs/index.md | 4 +-- examples/17/.lando.yml | 22 +++++++++++++ examples/17/README.md | 43 +++++++++++++++++++++++++ package-lock.json | 2 +- 8 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 examples/17/.lando.yml create mode 100644 examples/17/README.md diff --git a/.github/workflows/pr-postgres-tests.yml b/.github/workflows/pr-postgres-tests.yml index 944c9b9..48c7da3 100644 --- a/.github/workflows/pr-postgres-tests.yml +++ b/.github/workflows/pr-postgres-tests.yml @@ -26,6 +26,7 @@ jobs: - examples/14 - examples/15 - examples/16 + - examples/17 - examples/custom steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d2dbcd..b450341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Added support for Postgres 17 + ## v1.5.0 - [September 1, 2025](https://github.com/lando/postgres/releases/tag/v1.5.0) * Switched images to [bitnamilegacy](https://github.com/bitnami/containers/issues/83267) namespace diff --git a/builders/postgres.js b/builders/postgres.js index 091cff1..564a4b6 100644 --- a/builders/postgres.js +++ b/builders/postgres.js @@ -11,8 +11,9 @@ module.exports = { name: 'postgres', config: { version: '10', - supported: ['16', '15', '14', '13', '12', '11', '11.1', '11.0', '10', '10.6.0', '9.6'], + supported: ['17', '16', '15', '14', '13', '12', '11', '11.1', '11.0', '10', '10.6.0', '9.6'], pinPairs: { + '17': 'bitnamilegacy/postgresql:17.6.0-debian-12-r4', '16': 'bitnamilegacy/postgresql:16.6.0-debian-12-r2', '15': 'bitnamilegacy/postgresql:15.10.0-debian-12-r2', '14': 'bitnamilegacy/postgresql:14.18.0-debian-12-r0', diff --git a/docs/config.md b/docs/config.md index ac1df74..84dfbf6 100644 --- a/docs/config.md +++ b/docs/config.md @@ -27,7 +27,7 @@ To upgrade the PostgreSQL major version you need to: ```yaml services: myservice: - type: postgres:16 + type: postgres:17 portforward: false creds: database: database @@ -53,7 +53,7 @@ services: ```yaml services: myservice: - type: postgres:16 + type: postgres:17 portforward: true ``` @@ -62,7 +62,7 @@ services: ```yaml services: myservice: - type: postgres:16 + type: postgres:17 portforward: 5432 ``` @@ -110,7 +110,7 @@ Note that you can put your configuration files anywhere inside your application ```yaml services: myservice: - type: postgres:16 + type: postgres:17 config: database: config/my-custom.conf ``` diff --git a/docs/index.md b/docs/index.md index f072d07..cd0bc43 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,11 +13,12 @@ You can easily add it to your Lando app by adding an entry to the [services](htt ```yaml services: myservice: - type: postgres:16 + type: postgres:17 ``` ## Supported versions +* [17](https://hub.docker.com/r/bitnamilegacy/postgresql/tags?name=17.) * [16](https://hub.docker.com/r/bitnamilegacy/postgresql/tags?name=16.) * [15](https://hub.docker.com/r/bitnamilegacy/postgresql/tags?name=15.) * [14](https://hub.docker.com/r/bitnamilegacy/postgresql/tags?name=14.) @@ -45,4 +46,3 @@ services: ``` But make sure you use one of the available [patch tags](https://hub.docker.com/r/bitnamilegacy/postgresql/tags) for the underlying image we are using. - diff --git a/examples/17/.lando.yml b/examples/17/.lando.yml new file mode 100644 index 0000000..6ab72b7 --- /dev/null +++ b/examples/17/.lando.yml @@ -0,0 +1,22 @@ +name: lando-postgres-17 +services: + defaults: + type: postgres:17 + cross: + type: postgres:17 + portforward: true +tooling: + healthcheckdefaults: + service: defaults + cmd: psql -U postgres -c "\\l" + verifydefaultsdatabase: + service: defaults + cmd: psql -P pager=off -U postgres -c "\dt *.*" + crossconnect: + service: defaults + cmd: psql -P pager=off -h cross -U postgres -c "\dt *.*" + +# This is important because it lets lando know to test against the plugin in this repo +# DO NOT REMOVE THIS! +plugins: + "@lando/postgres": ../.. diff --git a/examples/17/README.md b/examples/17/README.md new file mode 100644 index 0000000..328a79e --- /dev/null +++ b/examples/17/README.md @@ -0,0 +1,43 @@ +# PostgreSQL 17 Example + +This example exists primarily to test the following documentation: + +* [Postgres Service](https://docs.lando.dev/plugins/postgres) + +## Start up tests + +Run the following commands to get up and running with this example. + +```bash +# Should start up successfully +lando poweroff +lando start +``` + +## Verification commands + +Run the following commands to validate things are rolling as they should. + +```bash +# Should use 17 as the specified version +lando exec defaults -- psql -V | grep "17" + +# Should see the default database on healthcheck +lando healthcheckdefaults | grep 'database' + +# Should use the correct default user pass db +lando verifydefaultsdatabase | grep 'pg_database' + +# Should be able to receive connections from the outside +lando crossconnect | grep 'pg_database' +``` + +## Destroy tests + +Run the following commands to trash this app like nothing ever happened. + +```bash +# Should be destroyed with success +lando destroy -y +lando poweroff +``` diff --git a/package-lock.json b/package-lock.json index 90f508d..2bf8344 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@lando/postgres", - "version": "1.4.4", + "version": "1.5.0", "bundleDependencies": [ "lodash" ],