migrate(plextraktsync) migrate plextraktsync to new common **BREAKING CHANGES** (#12887)

**Description**
migrate app and set a static semver tag
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [X] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 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

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ 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._

---------

Signed-off-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Xstar97TheNoob
2023-09-24 07:28:31 -04:00
committed by GitHub
parent bc778e62f5
commit e59e0e3360
6 changed files with 119 additions and 122 deletions

View File

@@ -1,14 +1,9 @@
annotations:
truecharts.org/SCALE-support: "true"
truecharts.org/catagories: |
- Tools-Utilities
- MediaApp-Other
apiVersion: v2
appVersion: "latest"
appVersion: "0.27.7"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
version: 14.0.3
deprecated: false
description: Two-way-sync between trakt.tv and Plex Media Server.
home: https://truecharts.org/charts/incubator/plextraktsync
@@ -27,4 +22,9 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/plextraktsync
- https://github.com/Taxel/PlexTraktSync
type: application
version: 3.0.19
version: 4.0.0
annotations:
truecharts.org/catagories: |
- Tools-Utilities
- MediaApp-Other
truecharts.org/SCALE-support: "true"

View File

@@ -8,65 +8,75 @@ questions:
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
- variable: plexTraktSync
- variable: plextraktsync
group: App Configuration
label: Plex Trakt Sync Config
schema:
additional_attrs: true
type: dict
attrs:
- variable: task
label: Task
description: Task to run on schedule. Leave empty for default. Default is <sync --sync=all>
- variable: cron_enabled
label: "Enable cronjob"
schema:
type: string
default: ""
- variable: schedule
label: Schedule
description: How often to run the task
schema:
type: string
default: "0 */6 * * *"
type: boolean
default: true
show_subquestions_if: true
subquestions:
- variable: task
label: Task
description: Task to run on schedule. Leave empty for default. Default is <sync --sync=all>
schema:
type: string
default: ""
- variable: schedule
label: Schedule
description: How often to run the task.
schema:
type: string
default: "0 */6 * * *"
# Include{containerConfig}
# Include{podOptions}
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: config
label: Config Storage
description: Container Path Config
label: App Config Storage
description: Stores the Application Configuration.
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{securityContextRoot}
# Include{podSecurityContextRoot}
- variable: runAsUser
label: runAsUser
description: The UserID of the user running the application
schema:
type: int
default: 0
- variable: runAsGroup
label: runAsGroup
description: The groupID this App of the user running the application
schema:
type: int
default: 0
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 0
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID this App of the user running the application"
schema:
type: int
default: 0
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: fsGroup
description: The group that should own ALL storage.
schema:
type: int
default: 568
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{resources}
# Include{advanced}

View File

@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@@ -1,52 +1,27 @@
{{/* Define the cronjob */}}
{{- define "plextraktsync.cronjob" -}}
{{- $jobName := include "tc.common.names.fullname" . }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ printf "%s-cronjob" $jobName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
spec:
schedule: "{{ .Values.plexTraktSync.schedule }}"
concurrencyPolicy: Forbid
{{- with .Values.cronjob.failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.cronjob.successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ . }}
{{- end }}
jobTemplate:
metadata:
spec:
template:
metadata:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
restartPolicy: Never
containers:
- name: {{ .Chart.Name }}
securityContext:
privileged: false
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
runAsNonRoot: false
capabilities:
drop:
- ALL
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command:
- plextraktsync
{{- if .Values.plexTraktSync.task }}
- {{ .Values.plexTraktSync.task }}
{{- else }}
- sync --sync=all
{{- end }}
resources:
{{ toYaml .Values.resources | indent 16 }}
enabled: true
type: "CronJob"
schedule: "{{ .Values.plextraktsync.schedule }}"
podSpec:
restartPolicy: Never
containers:
cron:
enabled: true
primary: true
imageSelector: "image"
command:
- plextraktsync
{{- if .Values.plextraktsync.task }}
- {{ .Values.plextraktsync.task }}
{{- else }}
- sync --sync=all
{{- end }}
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
{{- end -}}

View File

@@ -1,7 +1,13 @@
{{- include "tc.common.loader.init" . }}
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}
{{/* Render cronjob for clamav */}}
{{- include "plextraktsync.cronjob" . }}
{{- 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.common.loader.apply" . }}
{{ include "tc.v1.common.loader.apply" . }}

View File

@@ -1,30 +1,14 @@
image:
pullPolicy: IfNotPresent
repository: tccr.io/truecharts/plextraktsync
tag: latest@sha256:30cf60eb8d93995c358d88912c5dd7acf101a5673c0664016ca275718555d948
podSecurityContext:
runAsGroup: 0
runAsUser: 0
tag: v0.27.7@sha256:cefad9eed53955d91f1020d95c5f09f0f96c8cc5e89bcd25036cd6dd786d2a5d
securityContext:
readOnlyRootFilesystem: false
runAsNonRoot: false
tty: true
stdin: true
plexTraktSync:
task: ""
schedule: "0 */6 * * *"
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
container:
runAsNonRoot: false
readOnlyRootFilesystem: false
runAsUser: 0
runAsGroup: 0
service:
main:
@@ -33,15 +17,36 @@ service:
main:
enabled: false
plextraktsync:
cron_enabled: true
task: ""
schedule: "0 */6 * * *"
cronjob:
annotations: {}
failedJobsHistoryLimit: 5
successfulJobsHistoryLimit: 2
workload:
main:
podSpec:
containers:
main:
tty: true
stdin: true
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
persistence:
config:
enabled: true
mountPath: /app/config
portal:
enabled: false
cronjob:
annotations: {}
failedJobsHistoryLimit: 5
successfulJobsHistoryLimit: 2
open:
enabled: false