From 691eb7c7411ee7eedcebfc4982e1ef10c22008df Mon Sep 17 00:00:00 2001 From: Marek Jagielski Date: Mon, 24 Aug 2026 14:12:57 +0200 Subject: [PATCH 1/2] feat(nextcloud): allow suspending the cron CronJob via values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 1 + charts/nextcloud/templates/cronjob.yaml | 1 + charts/nextcloud/values.yaml | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index c4888034..61c92561 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 9.2.6 +version: 9.3.0 # renovate: image=docker.io/library/nextcloud appVersion: 34.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index fce52d3b..bd94bb23 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -216,6 +216,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `cronjob.sidecar.resources` | CPU/Memory resource requests/limits for the cron jobs sidecar | `{}` | | `cronjob.sidecar.securityContext` | Optional security context for cron jobs sidecar | `nil` | | `cronjob.cronjob.schedule` | Cron job schedule | `*/5 * * * *` | +| `cronjob.cronjob.suspend` | Suspend the cron job without removing it | `false` | | `cronjob.cronjob.successfulJobsHistoryLimit` | Number of successful jobs to keep in history | `3` | | `cronjob.cronjob.failedJobsHistoryLimit` | Number of failed jobs to keep in history | `5` | | `cronjob.cronjob.labels` | An array of service labels | `nil` | diff --git a/charts/nextcloud/templates/cronjob.yaml b/charts/nextcloud/templates/cronjob.yaml index 3beeff4e..05f0d6f4 100644 --- a/charts/nextcloud/templates/cronjob.yaml +++ b/charts/nextcloud/templates/cronjob.yaml @@ -16,6 +16,7 @@ metadata: {{- end }} spec: schedule: {{ .schedule | quote }} + suspend: {{ .suspend | default false }} concurrencyPolicy: Forbid successfulJobsHistoryLimit: {{ .successfulJobsHistoryLimit }} failedJobsHistoryLimit: {{ .failedJobsHistoryLimit }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 6c55d741..860ad7ad 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -709,6 +709,8 @@ cronjob: # crond does not work when not running as root user # Note: requires `persistence.enabled=true` schedule: "*/5 * * * *" + # Suspend the cron job without removing it + suspend: false successfulJobsHistoryLimit: 3 failedJobsHistoryLimit: 5 activeDeadlineSeconds: From a78e2d83ac551f8063ab720480d83227b827b86a Mon Sep 17 00:00:00 2001 From: Marek Jagielski Date: Wed, 26 Aug 2026 00:54:46 +0200 Subject: [PATCH 2/2] feat(nextcloud): take the suspend default from values.yaml alone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `values.yaml` already declares `cronjob.cronjob.suspend: false`, so the `| default false` pipeline in the template held a second copy of the same default that could never actually fire — Helm merges the chart defaults under any user-supplied values before the template runs. Drop it, matching the surrounding fields in the same block (`successfulJobsHistoryLimit`, `failedJobsHistoryLimit`), which read their values straight through. Rendering is unchanged: `suspend: false` by default, `suspend: true` with `--set cronjob.cronjob.suspend=true`. Signed-off-by: Marek Jagielski --- charts/nextcloud/templates/cronjob.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/templates/cronjob.yaml b/charts/nextcloud/templates/cronjob.yaml index 05f0d6f4..b0fa7d74 100644 --- a/charts/nextcloud/templates/cronjob.yaml +++ b/charts/nextcloud/templates/cronjob.yaml @@ -16,7 +16,7 @@ metadata: {{- end }} spec: schedule: {{ .schedule | quote }} - suspend: {{ .suspend | default false }} + suspend: {{ .suspend }} concurrencyPolicy: Forbid successfulJobsHistoryLimit: {{ .successfulJobsHistoryLimit }} failedJobsHistoryLimit: {{ .failedJobsHistoryLimit }}