feat: add support for non-local nginx implementations

If the scheduler is not docker-local, we will assume that a separate plugin trigger will pull access/error logs on our behalf. For k3s, the naive implementation is to pull logs from a single container (multiple ingress-nginx pods will be supported in a future release).

Closes #7268
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-10-17 00:18:24 -04:00
1 parent 7730ffda49
commit 611006af73
7 files changed
+315 -152

No files matched your search

+14 -1
View File
@@ -74,10 +74,23 @@ nginx_logs() {
dokku_log_fail "$NGINX_LOGS_TYPE logs are disabled for this app"
fi
local tail=false
local num=0
if [[ $3 == "-t" ]]; then
tail=true
else
num=20
fi
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
plugn trigger scheduler-nginx-logs "$DOKKU_SCHEDULER" "$APP" "nginx" "$NGINX_LOGS_TYPE" "$tail" "$num"
fi
if [[ "$tail" == "true" ]]; then
local NGINX_LOGS_ARGS="-F"
else
local NGINX_LOGS_ARGS="-n 20"
local NGINX_LOGS_ARGS="-n $num"
fi
tail "$NGINX_LOGS_ARGS" "$NGINX_LOGS_PATH"