fix: always set -- on docker run commands internally to avoid parsing flags on specified commands

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-18 21:00:42 -05:00
parent 59f74cbccf
commit 5ffbcf24de
4 changed files with 7 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ func (t TemplateCommand) CronCommand() string {
return t.AltCommand
}
return fmt.Sprintf("dokku run --cron-id %s %s %s", t.ID, t.App, t.Command)
return fmt.Sprintf("dokku run --cron-id %s %s -- %s", t.ID, t.App, t.Command)
}
func FetchCronEntries(appName string) ([]TemplateCommand, error) {

View File

@@ -109,7 +109,7 @@ func CommandRun(appName string, cronID string, detached bool) error {
os.Setenv("DOKKU_CRON_ID", cronID)
os.Setenv("DOKKU_RM_CONTAINER", "1")
scheduler := common.GetAppScheduler(appName)
args := append([]string{scheduler, appName, "0"}, fields...)
args := append([]string{scheduler, appName, "0", "--"}, fields...)
return common.PlugnTrigger("scheduler-run", args...)
}