Pin a release's image by digest, and refuse downgrades without --downgrade
After pulling a release, coreapps records its registry digest and runs image:version@sha256:..., so a re-pushed tag can't change an installed app; installing that release again with another digest is refused. An older release than the installed one needs --downgrade (coreapps install/plan, coreapp install), since it may not understand the newer one's data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -433,7 +433,23 @@ has a `coreapp.toml` with a published, public `image` (e.g. after
|
||||
`/federated/services/<name>/.coreapp` has `source`, `tag`, `commit`.
|
||||
2. Publish a newer version, then `coreapp update <name>`: "Updated", the
|
||||
old image is gone from the Core. Again: "at the newest release".
|
||||
3. `coreapp install <url>@v<old version>`: installs that tag.
|
||||
3. `coreapp install <url>@v<old version>` with a newer one installed:
|
||||
"is older, and may not understand the data ... add --downgrade", nothing
|
||||
changed. `coreapp install --downgrade <url>@v<old version>`: the plan
|
||||
says "Goes back from the installed v<new>", then installs that tag; the
|
||||
newer image is gone from the Core.
|
||||
3a. Digest: after installing, "Image: <image>:<version>@sha256:..."; the
|
||||
marker has `digest=`, the `.env` `IMAGE_DIGEST=@sha256:...`, `docker
|
||||
compose config --images` and the container's image are
|
||||
`<image>:<version>@sha256:...`. Push another image to the same tag, then
|
||||
install that release again: "isn't the image installed here ... the
|
||||
release was changed after it was published", the app keeps running,
|
||||
`<image>:<version>` on the Core is the installed image again, and
|
||||
`docker compose up --force-recreate` runs it. An app deployed from a
|
||||
folder has `IMAGE_DIGEST=` (empty) and runs `<image>:<version>`.
|
||||
(Tested with a registry on the Core, `docker run -p 127.0.0.1:5000:5000
|
||||
registry:2`, `image = "localhost:5000/<name>"`, and a `file://`
|
||||
repository as below.)
|
||||
4. Refused with a message, nothing changed:
|
||||
- a URL with a password (`https://u:p@host/o/r`), `http://`, `ssh://`,
|
||||
or one level only (`https://host/repo`)
|
||||
@@ -459,8 +475,9 @@ has a `coreapp.toml` with a published, public `image` (e.g. after
|
||||
|
||||
Without a public repository, the fetch can be tested on a local bare
|
||||
repository (`git config uploadpack.allowFilter true`) by loading
|
||||
`core/coreapps` as a module and replacing `REPO_URL`, `normalize_url` and
|
||||
`GIT_ENV["GIT_ALLOW_PROTOCOL"]` for `file://` (only in the test).
|
||||
`core/coreapps` as a module and replacing `REPO_URL`, `normalize_url`,
|
||||
`resolve` and `GIT_ENV["GIT_ALLOW_PROTOCOL"]` for `file://` (only in the
|
||||
test).
|
||||
|
||||
## Publishing (coreapp publish)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user