From 873bf701223530d4cefa82cf290554ce219eb738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfred=20G=C3=B6ppel?= <43101280+alfi0812@users.noreply.github.com> Date: Sun, 20 Apr 2025 17:26:49 +0200 Subject: [PATCH] fix(plextraktsync): BREAKING Move cronjob to values and fix persistence (#34600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made changes to the documentation - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning - [x] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/stable/plextraktsync/Chart.yaml | 2 +- .../stable/plextraktsync/ci/cron-values.yaml | 2 +- .../plextraktsync/templates/_cronjob.tpl | 26 -------------- .../plextraktsync/templates/common.yaml | 14 +------- charts/stable/plextraktsync/values.yaml | 35 +++++++++++++++---- 5 files changed, 32 insertions(+), 47 deletions(-) delete mode 100644 charts/stable/plextraktsync/templates/_cronjob.tpl diff --git a/charts/stable/plextraktsync/Chart.yaml b/charts/stable/plextraktsync/Chart.yaml index cb0ad99aff9..3f9c1f29675 100644 --- a/charts/stable/plextraktsync/Chart.yaml +++ b/charts/stable/plextraktsync/Chart.yaml @@ -37,5 +37,5 @@ sources: - https://github.com/Taxel/PlexTraktSync - https://github.com/truecharts/charts/tree/master/charts/stable/plextraktsync type: application -version: 9.8.8 +version: 10.0.0 diff --git a/charts/stable/plextraktsync/ci/cron-values.yaml b/charts/stable/plextraktsync/ci/cron-values.yaml index 90594145c97..9e900688055 100644 --- a/charts/stable/plextraktsync/ci/cron-values.yaml +++ b/charts/stable/plextraktsync/ci/cron-values.yaml @@ -1,4 +1,4 @@ plextraktsync: cron_enabled: true - task: "" + task: "sync" schedule: "*/1 * * * *" diff --git a/charts/stable/plextraktsync/templates/_cronjob.tpl b/charts/stable/plextraktsync/templates/_cronjob.tpl deleted file mode 100644 index 5e53b9e5cd3..00000000000 --- a/charts/stable/plextraktsync/templates/_cronjob.tpl +++ /dev/null @@ -1,26 +0,0 @@ -{{/* Define the cronjob */}} -{{- define "plextraktsync.cronjob" -}} -enabled: true -type: "CronJob" -schedule: "{{ .Values.plextraktsync.schedule }}" -podSpec: - restartPolicy: Never - containers: - cron: - enabled: true - primary: true - imageSelector: "image" - args: - {{- if .Values.plextraktsync.task }} - - {{ .Values.plextraktsync.task }} - {{- else }} - - sync - {{- end }} - probes: - liveness: - enabled: false - readiness: - enabled: false - startup: - enabled: false -{{- end -}} diff --git a/charts/stable/plextraktsync/templates/common.yaml b/charts/stable/plextraktsync/templates/common.yaml index f21ed3d43ed..b51394e00a4 100644 --- a/charts/stable/plextraktsync/templates/common.yaml +++ b/charts/stable/plextraktsync/templates/common.yaml @@ -1,13 +1 @@ -{{/* Make sure all variables are set properly */}} -{{- include "tc.v1.common.loader.init" . }} - -{{- if and .Values.plextraktsync.cron_enabled .Values.plextraktsync.schedule}} - {{/* Render cronjob for plextraktsync */}} - {{- $cronjob := include "plextraktsync.cronjob" . | fromYaml -}} - {{- if $cronjob -}} - {{- $_ := set .Values.workload "cron" $cronjob -}} - {{- end -}} -{{- end -}} - -{{/* Render the templates */}} -{{ include "tc.v1.common.loader.apply" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/stable/plextraktsync/values.yaml b/charts/stable/plextraktsync/values.yaml index c83fbdcafc3..8dfa1e947e4 100644 --- a/charts/stable/plextraktsync/values.yaml +++ b/charts/stable/plextraktsync/values.yaml @@ -19,14 +19,9 @@ service: plextraktsync: cron_enabled: true - task: "" + task: "sync" schedule: "0 */6 * * *" -cronjob: - annotations: {} - failedJobsHistoryLimit: 5 - successfulJobsHistoryLimit: 2 - workload: main: podSpec: @@ -41,8 +36,36 @@ workload: enabled: false startup: enabled: false + plextraktsync-cron: + enabled: "{{ .Values.plextraktsync.cron_enabled }}" + type: CronJob + schedule: "{{ .Values.plextraktsync.schedule }}" + podSpec: + restartPolicy: Never + containers: + cron: + primary: true + enabled: true + imageSelector: "image" + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + args: + - "{{ .Values.plextraktsync.task }}" persistence: config: enabled: true mountPath: /app/config + targetSelector: + main: + main: + mountPath: /var/www/html + plextraktsync-cron: + cron: + mountPath: /var/www/html +