Skip to content

feat(presets): mysql 9.7 LTS, postgres 17/18, canonical version pinning#361

Merged
geodro merged 1 commit into
mainfrom
feat/postgres-mysql-multi-version-presets
May 16, 2026
Merged

feat(presets): mysql 9.7 LTS, postgres 17/18, canonical version pinning#361
geodro merged 1 commit into
mainfrom
feat/postgres-mysql-multi-version-presets

Conversation

@geodro
Copy link
Copy Markdown
Owner

@geodro geodro commented May 16, 2026

Summary

Adds MySQL 9.7 LTS as an alternate to the mysql preset and restructures postgres into a multi-version preset with 16 canonical plus 17 and 18 alternates, closing the catalogue request in #360. The legacy mysql 8.0 alternate is removed because the canonical 8.4 LTS already covers that line and keeping both produced an awkward duplicate in the picker.

The bulk of the diff is the supporting infrastructure that makes future canonical promotions safe. Multi-version presets now snapshot the canonical version tag at install time into ServiceConfig.CanonicalVersion, and the reconcile loop resolves against that pin instead of whatever the YAML currently calls canonical. So when a later release flips postgres canonical from 16 to 18, existing installs stay on 16 because their pin says so, fresh installs land on 18 and get pinned to it, and only lerd service migrate updates the pin to reflect an intentional cross-major move. Pre-existing installs get backfilled from the running image's tag on the next reconcile so the protection works retroactively.

Postgres 18's upstream image moved the default PGDATA into a version subdirectory and refuses to start with the legacy mount layout, so the preset pins PGDATA=/var/lib/postgresql/data which is a no-op on 16 and 17 but forces 18 onto the layout we mount. MySQL 9.x removed mysql_native_password entirely and the shared lerd.cnf named it in authentication_policy, which broke server init across the whole 9.x line; the line is gone and the default caching_sha2_password works on every supported version.

pgadmin now auto-discovers postgres family members the same way phpmyadmin handles mysql and mariadb. A dynamic_env directive registers pgadmin as a postgres family consumer so RegenerateFamilyConsumers rebuilds its quadlet whenever an alternate is installed, removed, started, or stopped. The servers.json and pgpass mounts are generated at materialise time from ServicesInFamily("postgres") instead of being static, and PGADMIN_REPLACE_SERVERS_ON_STARTUP=True makes pgadmin re-import on every restart so newly installed alternates show up in the dashboard immediately. To support generated file content, FileMount gained an optional ContentFn alongside the static Content field.

Docs in docs/usage/services.md and docs/usage/service-presets.md are updated with the new version tables, alternate host ports, and a short note about the canonical pinning behaviour.

Adds the new MySQL 9.7 LTS line as an alternate, restructures postgres
into a multi-version preset with 16 canonical plus 17 and 18 alternates,
and removes the obsolete mysql 8.0 alternate (8.4 LTS already covers
that line). Closes the request in #360.

Multi-version presets snapshot the canonical version tag at install
time into ServiceConfig.CanonicalVersion, so a future release flipping
the YAML's canonical (e.g. postgres 16 to 18) will no longer silently
major-jump existing installs. The pin survives reconciles, gets
backfilled from the running image for pre-pin installs, and is updated
by lerd service migrate when the user moves the canonical on purpose.

Postgres 18 needed PGDATA pinned to the legacy /var/lib/postgresql/data
path because the upstream image moved its default into a version
subdirectory and refuses to start otherwise. MySQL 9.x removed
mysql_native_password entirely, which was named in the shared lerd.cnf's
authentication_policy line and aborted init, so that line is gone and
the default caching_sha2_password is used on every supported version.

pgadmin now auto-discovers postgres family members the same way
phpmyadmin discovers mysql and mariadb: a dynamic_env directive
registers it as a family consumer, the servers.json and pgpass file
mounts are generated at materialise time from ServicesInFamily, and
PGADMIN_REPLACE_SERVERS_ON_STARTUP makes pgadmin re-import on every
restart so installing a postgres alternate immediately shows up in the
dashboard without a manual server-add step. To support that, FileMount
gained an optional ContentFn generator alongside the static Content
field.
@geodro geodro merged commit 50dfc74 into main May 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant