fix: hash scheduler-k3s cron-id label to fit Kubernetes' 63-byte cap

The `dokku.com/cron-id` label could exceed Kubernetes' 63-byte cap because the cron ID is `base36(appName === command === schedule)`, which expands roughly 1.5x per byte. The label is now keyed `dokku.com/cron-hash` and holds the `sha1` hex digest of the cron-id, a fixed 40-character value that always fits the cap. The same hex digest is mirrored into the `dokku.com/cron-hash` annotation, and the original base36 cron-id stays in the `dokku.com/cron-id` annotation that `cron:list` reads when surfacing user-facing IDs. Per-task lookups stay server-side via label selectors, so `cron:set --maintenance` and the forbid/replace concurrency checks on `dokku run --cron-id` keep working without any in-memory filtering.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-24 02:50:09 -04:00
parent 3c8cba08e5
commit bf2cfe1886
10 changed files with 235 additions and 51 deletions

View File

@@ -10,6 +10,7 @@ metadata:
annotations:
app.kubernetes.io/version: {{ $.Values.global.deployment_id | quote }}
dokku.com/builder-type: {{ $.Values.global.image.type | quote }}
dokku.com/cron-hash: {{ $config.cron.hash | quote }}
dokku.com/cron-id: {{ $config.cron.id | quote }}
dokku.com/job-suffix: {{ $config.cron.suffix | quote }}
dokku.com/managed: "true"
@@ -33,6 +34,7 @@ spec:
annotations:
app.kubernetes.io/version: {{ $.Values.global.deployment_id | quote }}
dokku.com/builder-type: {{ $.Values.global.image.type | quote }}
dokku.com/cron-hash: {{ $config.cron.hash | quote }}
dokku.com/cron-id: {{ $config.cron.id | quote }}
dokku.com/job-suffix: {{ $config.cron.suffix | quote }}
dokku.com/managed: "true"
@@ -56,6 +58,7 @@ spec:
annotations:
app.kubernetes.io/version: {{ $.Values.global.deployment_id | quote }}
dokku.com/builder-type: {{ $.Values.global.image.type | quote }}
dokku.com/cron-hash: {{ $config.cron.hash | quote }}
dokku.com/cron-id: {{ $config.cron.id | quote }}
dokku.com/job-suffix: {{ $config.cron.suffix | quote }}
dokku.com/managed: "true"