From 7bce908c2d1e822cf69e6226f562b9388b51b4c9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 18 Jan 2024 17:15:42 -0500 Subject: [PATCH] fix: properly set the command for herokuish apps --- plugins/scheduler-k3s/functions.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index bec2feb88..736056e8c 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -153,7 +153,7 @@ func enterPod(ctx context.Context, input EnterPodInput) error { func extractStartCommand(input StartCommandInput) string { command := "" if input.ImageSourceType == "herokuish" { - command = "/start " + input.ProcessType + return "/start " + input.ProcessType } startCommandResp, err := common.CallPlugnTrigger(common.PlugnTriggerInput{ @@ -162,14 +162,10 @@ func extractStartCommand(input StartCommandInput) string { CaptureOutput: true, StreamStdio: false, }) - if err == nil && startCommandResp.ExitCode == 0 { + if err == nil && startCommandResp.ExitCode == 0 && len(startCommandResp.Stdout) > 0 { command = startCommandResp.Stdout } - if input.ImageSourceType == "herokuish" { - return command - } - if input.ImageSourceType == "dockerfile" { startCommandDockerfileResp, err := common.CallPlugnTrigger(common.PlugnTriggerInput{ Trigger: "config-get", @@ -177,7 +173,7 @@ func extractStartCommand(input StartCommandInput) string { CaptureOutput: true, StreamStdio: false, }) - if err == nil && startCommandDockerfileResp.ExitCode == 0 { + if err == nil && startCommandDockerfileResp.ExitCode == 0 && len(startCommandDockerfileResp.Stdout) > 0 { command = startCommandDockerfileResp.Stdout } }