fix: fail deploy tasks when a docker-args trigger fails

The ephemeral containers that run `app.json` deploy tasks ignored a failure from the `docker-args-deploy` and `docker-args-process-deploy` triggers, so a plugin refusing to describe the container produced a task that ran without the arguments it had asked for, while the very same failure aborted the deploy moments later on the scheduler's own path. Both are now fatal, which the trigger documentation states. Storage no longer reports a scheduler mismatch for an app deploying with another scheduler, since those triggers are fired for every app whatever its scheduler and a k3s app's volumes are mounted by k3s rather than bound into a container here.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-09-21 23:35:28 -04:00
1 parent 14bdc1b2bd
commit 17cf249f2e
5 files changed
+70 -15

No files matched your search

+32
View File
@@ -109,6 +109,38 @@ func TestTriggerDockerArgsRejectsSchedulerMismatchOutOfScope(t *testing.T) {
Expect(err).To(HaveOccurred())
}
// TestDockerVFlagsForProcessSkipsOtherSchedulers covers apps that do not
// deploy with docker-local. The docker-args triggers are fired for every app -
// the app.json deploy-task path builds its ephemeral container with docker
// whatever the app's scheduler is - so a k3s app reaches this code with k3s
// entries attached. Those are PersistentVolumeClaims its own scheduler mounts,
// so the right answer is no flags, not an error.
func TestDockerVFlagsForProcessSkipsOtherSchedulers(t *testing.T) {
RegisterTestingT(t)
root := withTempLibRoot(t)
previous := appSchedulerFor
appSchedulerFor = func(string) string { return SchedulerK3s }
t.Cleanup(func() { appSchedulerFor = previous })
Expect(SaveEntry(&Entry{
Name: "demo-pvc",
Scheduler: SchedulerK3s,
})).To(Succeed())
writeAttachmentsFile(t, root, "demo", []*Attachment{
{
EntryName: "demo-pvc",
ContainerPath: "/data",
Phases: []string{PhaseDeploy},
},
})
flags, err := dockerVFlagsForProcess("demo", PhaseDeploy, "web")
Expect(err).NotTo(HaveOccurred())
Expect(flags).To(BeEmpty())
}
// TestDockerVFlagsForProcessScopes is the docker-local half of #9059. An
// attachment scoped to a named process type reaches that process only; the
// default scope reaches every process, including containers that belong to no