From 51b951643b16c05197755c80644e8b2abd10d33b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 21 Oct 2024 21:51:37 -0400 Subject: [PATCH] fix: respect the exit code and pass flags correctly when tailing nginx logs on k3s --- plugins/nginx-vhosts/functions | 1 + plugins/scheduler-k3s/triggers.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 538cf6f64..b4a21a6b1 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -85,6 +85,7 @@ nginx_logs() { local DOKKU_SCHEDULER=$(get_app_scheduler "$APP") if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then plugn trigger scheduler-proxy-logs "$DOKKU_SCHEDULER" "$APP" "nginx" "$NGINX_LOGS_TYPE" "$tail" "$num" + return $? fi if [[ "$tail" == "true" ]]; then diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index ec465c9bc..d98c19135 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -866,7 +866,8 @@ func TriggerSchedulerProxyLogs(scheduler string, appName string, proxyType strin command = append(command, "-F") } if numLines > 0 { - command = append(command, fmt.Sprintf("-n %d", numLines)) + command = append(command, "-n") + command = append(command, strconv.FormatInt(numLines, 10)) } command = append(command, filename)