fix: honor storage attachment process types at deploy time

An attachment's process type was recorded, reported and used to scope `storage:mount --replace` and `storage:unmount --all`, but nothing read it when the volume was actually mounted, so `storage:mount <app> <entry> --container-dir <path> --process-type web` bound the volume into every process rather than only `web`. Both schedulers now scope a mount to the process type it was declared for, and containers that belong to no process type - a `dokku run` one-off, an `app.json` deploy task, a k3s cron job - receive default-scoped mounts only. A container path can now be claimed by a single mount per process type, and `storage:migrate` drains process-scoped `-v` lines out of `docker-options` rather than only the default-scoped ones.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-09-21 18:08:42 -04:00
1 parent e00e939f25
commit b612285392
20 files changed
+1075 -114

No files matched your search

+13 -3
View File
@@ -28,12 +28,22 @@ func main() {
appName := flag.Arg(0)
phase := flag.Arg(1)
err = storage.TriggerStorageAppMounts(appName, phase)
case "docker-args-process-deploy":
appName := flag.Arg(0)
processType := flag.Arg(3)
err = storage.TriggerDockerArgs(appName, storage.PhaseDeploy, processType)
case "docker-args-deploy":
appName := flag.Arg(0)
err = storage.TriggerDockerArgs(appName, storage.PhaseDeploy)
// No longer registered in the plugin Makefile; storage emits its
// deploy-phase flags through docker-args-process-deploy, which every
// caller of this trigger also invokes. The case remains so a symlink
// left behind by an older build resolves to a no-op rather than
// falling through to the error below and failing the deploy.
err = nil
case "docker-args-run":
// A `dokku run` container belongs to no process type, so only
// default-scoped attachments apply.
appName := flag.Arg(0)
err = storage.TriggerDockerArgs(appName, storage.PhaseRun)
err = storage.TriggerDockerArgs(appName, storage.PhaseRun, storage.DefaultProcessType)
case "post-delete":
appName := flag.Arg(0)
err = storage.TriggerPostDelete(appName)