Repository navigation
Name our images localhost/dbpantry-* and never fall back to ghcr.io - #30
Merged
Merged
Conversation
dbpantry publishes no image (D-77), but every image was still built, run
and deployed as ghcr.io/simtabi/dbpantry-*, so a cluster missing one
pulled from a registry that holds nothing. One default now names them:
MDB_IMAGE_PREFIX_DEFAULT=localhost in scripts/env-lib.sh, with
mdb_image_prefix, mdb_image and mdb_image_ref. It replaces every hard-coded
registry in Compose, the generated engine and pooler services, the patroni
build, the Makefile, five scripts, six checks and both scan steps. The Helm
chart defaults global.imageRegistry to localhost, helm-values passes it the
prefix in force, and kind loading follows it. A set MDB_IMAGE_PREFIX or
global.imageRegistry still prefixes every image.
localhost rather than an unqualified name: check 49 and Podman need a
fully qualified reference, and Docker would expand a short one to Docker
Hub. Check 49 now resolves every ${VAR:-default} in a reference. New check
73 holds every default to localhost, fails on a remote registry for our
images, and proves a set prefix reaches every image. Recorded as D-78;
existing local images need one make build.
The first CI run failed four checks, each a reader of the old image name that the literal search for ghcr.io/simtabi missed: - check 42 allowlisted our images as ghcr\.io/simtabi/[a-z-]+, and check 72 matched them by the same regex, so the pooler read as a third-party rebuild and our images as having no healthcheck. Both now name localhost/dbpantry-*; 72 under the prefix in force. - scripts/init passed the caddy service's raw image: line, now Compose syntax, to run, so make init-prod (check 26) failed. It resolves the line with the new mdb_compose_ref first. - check 73 listed one image in CI: make verify exports COMPOSE_PROFILES, which helm-values ranks above the MDB_PROFILES the check set. It sets both, counts the escaped spelling, and fails on any script that runs a Compose image: line without mdb_compose_ref.
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
dbpantry publishes no image (D-77), yet every image was still built, run and deployed as
ghcr.io/simtabi/dbpantry-*. A kind, minikube or real cluster missing an image therefore pulled from a registry that holds nothing. Our images are now namedlocalhost/dbpantry-<component>:<tag>, from one default (owner: "Yes, use localhost/"), and nothing falls back to ghcr.io.MDB_IMAGE_PREFIX_DEFAULT=localhostinscripts/env-lib.sh, withmdb_image_prefix,mdb_imageandmdb_image_ref.mdb_image_refmoves the pooler descriptor'slocalhost/dbpantry-pgbouncer:devto the prefix in force.${MDB_IMAGE_PREFIX:-localhost}), the patroni Dockerfile'sARG IMAGE_PREFIX, the chart'sglobal.imageRegistry, the pooler descriptor, and the CI scan steps.MDB_IMAGE_PREFIX=registry.example.com/teamandmake build, Compose, the scripts andmake upall use it. On Kubernetes,scripts/helm-valuesrendersglobal.imageRegistryfrom it, and the backend's kind loading reads that value back, so kind loads exactly the names the chart runs. Settingglobal.imageRegistryby hand prefixes every chart image too.imagePullPolicystaysIfNotPresent.localhost/rather thandbpantry/<component>: check 49 requires a fully qualified reference, because Podman refuses short names (D-60), and Docker would expand a short name to Docker Hub on a pull.localhostis fully qualified, is Podman's own prefix for local builds, reaches no remote registry, and loads into kind and minikube as it is.docs/guides/kubernetes.mdhas a new Images section coveringmake build,kind load docker-image(automatic on kind contexts),minikube image load, and pushing to your own registry withMDB_IMAGE_PREFIX. It also updates the quick start, requirements, settings table and troubleshooting.ghcr.io/simtabimentions that remain only describe the frozen images or their history.${VAR:-default}, so it would have read${MDB_IMAGE_PREFIX:-localhost}/dbpantry-pg:${…}aslocalhost}/…. It now resolves every default, innermost first, and still counts 55 references.images-local-by-default(fast, structure):localhost, and every Compose image line takes its prefix from${MDB_IMAGE_PREFIX:-localhost}dbpantry-, across 321 filesghcr.io/simtabiappears only in 9 files that describe the frozen images, each held to its measured countmdb_image, the pooler,make shell,helm-values, kind loading and the rendered chartdesign.md. The CHANGELOG has an Upgrade note: existing local images keep their old names, so runmake buildonce and the nextmake uprecreates the containers; volumes and data are untouched.Verification
make verify-structure: 73 checks, all well-formed.make lint: shellcheck clean.make go-ci: green. actionlint 1.7.12: clean.helm lint deploy/helm/dbpantry: 1 chart linted, 0 failed.helm template(helm 4) with pg (HA) and mysql renderslocalhost/dbpantry-patroni:17andlocalhost/dbpantry-mysql:8.4; with--set global.imageRegistry=registry.example.com/teamit rendersregistry.example.com/team/dbpantry-pg:17and…/dbpantry-mysql:8.4.make -n shellrunslocalhost/dbpantry-cli:dev, orregistry.example.com/team/dbpantry-cli:devwith the prefix exported. An emptyMDB_IMAGE_PREFIXnow counts as unset in Make too.cmp). Each of these failed:ghcr.io/simtabidocker.io/simtabighcr.io/simtabi/dbpantry-pgindocker-compose.ymlquay.io/…/dbpantry-cliinscripts/scanARG IMAGE_PREFIX=ghcr.io/simtabilocalhostglobal.imageRegistryhelm-valuesdroppingimageRegistryMDB_IMAGE_PREFIXmake verify) run in CI's verify jobs. Locally, a sandboxmktempshim was needed forgen-compose; nothing in the repo depends on it.Removed
ghcr.io/simtabiimage prefix:docker-compose.yml(caddy, pg, mysql, mariadb),compose.ha.yml(patroni, pgbouncer), and the engine servicesscripts/gen-composegeneratesengines/postgres/engine.conf) and the patroni Dockerfile'sARG IMAGE_PREFIXMakefile(make shell), andscripts/{build,upgrade,verify-backups,transfer,scan}scripts/verify/lib.sh(image_name) and checks 02, 08, 14, 29, 32 and 55ci.ymlandrelease.yml_mdb_k8s_local_images) and the chart'sglobal.imageRegistry: ghcr.io/simtabigh attestation verify oci://ghcr.io/…example, since no image is published. The guide now points at the frozen images.Nothing is deleted from ghcr.io.