feat(nextcloud): allow suspending the cron CronJob via values - #881
Open
marekjagielski wants to merge 1 commit into
Open
feat(nextcloud): allow suspending the cron CronJob via values#881marekjagielski wants to merge 1 commit into
marekjagielski wants to merge 1 commit into
Conversation
The CronJob template renders no `spec.suspend`, so the field has no desired value in the manifest. Anything that reconciles the chart's output — ArgoCD, Flux, `helm diff` — has nothing to compare against, and a `kubectl patch ... suspend=true` therefore survives every subsequent sync while the release keeps reporting as in-sync. That is not hypothetical: we had `nextcloud-cron` suspended by hand during a debugging session and left that way for 40 days. ArgoCD reconciled the object repeatedly over that period and left the suspension in place, because server-side apply correctly treats `spec.suspend` as owned by the client that set it. No file scans, no trashbin/version expiry, no notification delivery and no federated sync ran in that window, and nothing surfaced it. Render `suspend` unconditionally, defaulting to false, so the field is always present and always owned by whatever applies the chart. This also makes suspending the job a first-class values option rather than something you have to reach around the chart to do. Default behaviour is unchanged: `suspend: false` is the CronJob API default, so existing releases render an explicit false where the field was previously omitted. Signed-off-by: Marek Jagielski <marek.jagielski@protonmail.com>
marekjagielski
force-pushed
the
feat/cronjob-suspend
branch
from
August 24, 2026 12:23
003418e to
691eb7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
Renders
spec.suspendon the cron CronJob unconditionally (defaulting tofalse), and exposes it ascronjob.cronjob.suspend.Benefits
The template currently renders no
spec.suspendat all, so the field has no desired value in the manifest. Anything that reconciles the chart's output — ArgoCD, Flux,helm diff— has nothing to compare against, and under server-side apply akubectl patch ... suspend=truetakes ownership of the field and survives every subsequent sync, while the release keeps reporting as in-sync.That is not hypothetical. We had
nextcloud-cronsuspended by hand during a debugging session and left that way for days. ArgoCD reconciled that very object repeatedly across the period and left the suspension in place — correctly, since it did not own the field. In that window Nextcloud ran no file scans, no trashbin/version expiry, no notification delivery, no federated sync and no app-update checks, and nothing surfaced it.managedFieldsshowedspec.suspendowned bykubectl-patch, never byargocd-controller.Rendering the field always puts it back under the chart's ownership, so a manual patch is reverted on the next sync instead of silently persisting. It also makes suspending the job a first-class values option rather than something you reach around the chart to do.
Possible drawbacks
None that I can find.
falseis already the CronJob API default, so behaviour is unchanged for every existing release — the only difference is that a previously-omitted field now renders as an explicitfalse. For users who deliberately suspend the job out-of-band today, that manual patch will now be reverted on the next chart apply; settingcronjob.cronjob.suspend: trueis the supported replacement, and arguably the point of the change.Applicable issues
None open that I could find — happy to file one first if you'd prefer that order.
Additional information
Verified against
charts/nextcloud:helm lint .— 1 chart linted, 0 failedhelm template .withcronjob.enabled=true cronjob.type=cronjob→suspend: false--set cronjob.cronjob.suspend=true→suspend: truecronjob.type=sidecarrenders no CronJob, unaffectedvalues.yamland the README values tableChart.yamlbumped 9.2.6 → 9.3.0 (minor: adds a value, no breaking change)Checklist
Chart.yamlaccording to semver.