feat(presets): mysql 9.7 LTS, postgres 17/18, canonical version pinning#361
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onlylerd service migrateupdates 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
PGDATAinto a version subdirectory and refuses to start with the legacy mount layout, so the preset pinsPGDATA=/var/lib/postgresql/datawhich is a no-op on 16 and 17 but forces 18 onto the layout we mount. MySQL 9.x removedmysql_native_passwordentirely and the sharedlerd.cnfnamed it inauthentication_policy, which broke server init across the whole 9.x line; the line is gone and the defaultcaching_sha2_passwordworks on every supported version.pgadmin now auto-discovers postgres family members the same way phpmyadmin handles mysql and mariadb. A
dynamic_envdirective registers pgadmin as a postgres family consumer soRegenerateFamilyConsumersrebuilds its quadlet whenever an alternate is installed, removed, started, or stopped. Theservers.jsonandpgpassmounts are generated at materialise time fromServicesInFamily("postgres")instead of being static, andPGADMIN_REPLACE_SERVERS_ON_STARTUP=Truemakes pgadmin re-import on every restart so newly installed alternates show up in the dashboard immediately. To support generated file content,FileMountgained an optionalContentFnalongside the staticContentfield.Docs in
docs/usage/services.mdanddocs/usage/service-presets.mdare updated with the new version tables, alternate host ports, and a short note about the canonical pinning behaviour.