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

+19 -14
View File
@@ -182,34 +182,39 @@ func executeScript(appName string, image string, imageTag string, phase string)
imageSourceType = "pack"
}
// Both triggers are fatal here, the same way they are on the scheduler's
// own deploy path. Swallowing the error meant a plugin refusing to describe
// the container - a storage entry belonging to another scheduler, say -
// silently produced a deploy task running without the arguments it asked
// for, while the identical failure aborted the deploy a moment later.
var dockerArgs []string
results, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "docker-args-deploy",
Args: []string{appName, imageTag},
Stdin: strings.NewReader(""),
})
if err == nil {
words, err := shellquote.Split(results.StdoutContents())
if err != nil {
return err
}
dockerArgs = append(dockerArgs, words...)
if err != nil {
return fmt.Errorf("Error getting deploy docker args for %s task: %w", phase, err)
}
words, err := shellquote.Split(results.StdoutContents())
if err != nil {
return err
}
dockerArgs = append(dockerArgs, words...)
results, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "docker-args-process-deploy",
Args: []string{appName, imageSourceType, imageTag},
Stdin: strings.NewReader(""),
})
if err == nil {
words, err := shellquote.Split(results.StdoutContents())
if err != nil {
return err
}
dockerArgs = append(dockerArgs, words...)
if err != nil {
return fmt.Errorf("Error getting process deploy docker args for %s task: %w", phase, err)
}
words, err = shellquote.Split(results.StdoutContents())
if err != nil {
return err
}
dockerArgs = append(dockerArgs, words...)
filteredArgs := []string{
"--cpus",