feat: add vector-cron-sink for scheduled cron task output
Scheduled cron task output previously reached only the `dokku` user's cron mail, and could not be redirected because `app.json` rejects bare shell operators in a cron `command`. Setting `vector-cron-sink` on an app or globally routes that output to a dedicated sink instead, on both the `docker-local` and `k3s` schedulers, which keeps log destinations under operator control rather than in a deployed repository. Cron events carry `dokku_app` and `dokku_cron_id` fields so a sink can give each task its own destination. This also fixes a `k3s` bug where configuring a global `vector-sink` silently removed the vector prometheus exporter sink.
This commit is contained in:
@@ -22,7 +22,7 @@ func validateSetValue(appName string, key string, value string) error {
|
||||
return validateVectorNetworks(appName, value)
|
||||
}
|
||||
|
||||
if key == "vector-sink" {
|
||||
if key == "vector-sink" || key == "vector-cron-sink" {
|
||||
return validateVectorSink(appName, value)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func validateVectorSink(appName string, value string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := SinkValueToConfig(appName, value)
|
||||
_, err := SinkValueToConfig(SinkValueToConfigInput{SinkValue: value})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user