fix: support --global on cron:set

`cron:set --global` wrote the property but emitted `unknown flag: --global` because the post-set `scheduler-cron-write` trigger received `--global` as the appName arg, which pflag rejected before reaching the trigger body.

The trigger args now omit appName for global writes, and the `scheduler-k3s` cron-write trigger short-circuits when called without an app since per-app reconciliation requires a real app name. The docker-local trigger already regenerates the global crontab from all apps so global `mailfrom`/`mailto` are picked up without any further changes.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-13 12:37:14 -04:00
parent fee155a0a6
commit 4001f318a6
4 changed files with 84 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ The `cron` plugin provides a number of settings that can be used to managed depl
| Name | Description | Level | Global Default |
|-----------------------|----------------------------------------------------------------|-------------|----------------|
| `mailfrom` | Sets the `MAILFROM` variable in a cron file for cron reporting | Global-only | empty string |
| `maintenance` | Whether to have cron running for the app or not. | App-only | `false` |
| `maintenance` | Whether to have cron running for the app or not. | App and Global | `false` |
| `mailto` | Sets the `MAILTO` variable in a cron file for cron reporting | Global-only | empty string |
All settings can be set via the `cron:set` command. Using `maintenance` as an example: