migrate(plexanisync) migrate to new common (#10001)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ 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: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Xstar97TheNoob
2023-07-03 23:44:31 +03:00
committed by GitHub
co-authored by Stavros Kois
parent 7f3fd03c58
commit e974a01cb3
7 changed files with 66 additions and 66 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
apiVersion: v2 apiVersion: v2
appVersion: "latest" appVersion: "1.3.25"
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 11.1.2 version: 12.14.6
deprecated: false deprecated: false
description: Plex to AniList Sync. description: Plex to AniList Sync.
home: https://truecharts.org/charts/incubator/plexanisync home: https://truecharts.org/charts/incubator/plexanisync
@@ -22,7 +22,7 @@ sources:
- https://github.com/RickDB/PlexAniSync - https://github.com/RickDB/PlexAniSync
- https://github.com/RickDB/PlexAniSync/pkgs/container/plexanisync - https://github.com/RickDB/PlexAniSync/pkgs/container/plexanisync
type: application type: application
version: 2.0.0 version: 3.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - media
+8 -9
View File
@@ -4,13 +4,13 @@ questions:
# Include{global} # Include{global}
# Include{workload} # Include{workload}
# Include{workloadDeployment} # Include{workloadDeployment}
# Include{replicas1} # Include{replicas1}
# Include{podSpec} # Include{podSpec}
# Include{containerMain} # Include{containerMain}
# Include{containerBasic} # Include{containerBasic}
# Include{containerAdvanced} # Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
- variable: plexanisync - variable: plexanisync
group: App Configuration group: App Configuration
label: PlexAniSync Configuration label: PlexAniSync Configuration
@@ -31,16 +31,16 @@ questions:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: plex_section - variable: anime_section
label: Plex Section label: Anime Section
description: The libraries where your anime resides. description: The libraries where your anime resides.
schema: schema:
type: list type: list
required: true required: true
default: [] default: []
items: items:
- variable: plex_section_library_entry - variable: anime_section_library_entry
label: Plex Section Library Entry label: Anime Section Library Entry
description: Single library per entry. description: Single library per entry.
schema: schema:
type: string type: string
@@ -227,14 +227,13 @@ questions:
type: string type: string
required: true required: true
default: "" default: ""
# Include{containerConfig}
# Include{podOptions}
# Include{serviceExpertRoot} # Include{serviceExpertRoot}
# Include{serviceExpert} # Include{serviceExpert}
# Include{serviceList} # Include{serviceList}
# Include{persistenceList} # Include{persistenceList}
# Include{securityContextRoot} # Include{securityContextRoot}
- variable: runAsUser - variable: runAsUser
label: "runAsUser" label: "runAsUser"
description: "The UserID of the user running the application" description: "The UserID of the user running the application"
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
@@ -0,0 +1,7 @@
{{- define "plexanisync.config" -}}
{{- $pas := .Values.plexanisync }}
enabled: true
data:
SETTINGS_FILE: {{ .Values.persistence.settings.mountPath }}
INTERVAL: {{ $pas.interval | quote }}
{{- end -}}
@@ -1,31 +1,13 @@
{{/* Define the secret */}}
{{- define "plexanisync.secret" -}} {{- define "plexanisync.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }} {{- $pas := .Values.plexanisync -}}
{{- $secretConfigName := printf "%s-config-secret" (include "tc.common.names.fullname" .) }}
{{- $pas := .Values.plexanisync }}
{{- $cm := .Values.custom_mappings }} {{- $cm := .Values.custom_mappings }}
---
apiVersion: v1 enabled: true
kind: Secret data:
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
SETTINGS_FILE: {{ .Values.persistence.settings.mountPath }}
INTERVAL: {{ $pas.interval | quote }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretConfigName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
settings.ini: | settings.ini: |
[PLEX] [PLEX]
anime_section = {{ join "|" $pas.plex.plex_section }} anime_section = {{ join "|" $pas.plex.anime_section }}
authentication_method = {{ $pas.plex.plex_auth_method }} authentication_method = {{ $pas.plex.plex_auth_method }}
@@ -52,6 +34,7 @@ stringData:
skip_list_update = {{ ternary "True" "False" $pas.anilist.skip_list_update }} skip_list_update = {{ ternary "True" "False" $pas.anilist.skip_list_update }}
username = {{ $pas.anilist.ani_username }} username = {{ $pas.anilist.ani_username }}
log_failed_matches = {{ ternary "True" "False" $pas.anilist.log_failed_matches }} log_failed_matches = {{ ternary "True" "False" $pas.anilist.log_failed_matches }}
custom_mappings.yaml: | custom_mappings.yaml: |
# https://github.com/RickDB/PlexAniSync/blob/master/custom_mappings.yaml.example # https://github.com/RickDB/PlexAniSync/blob/master/custom_mappings.yaml.example
{{- if $cm }} {{- if $cm }}
@@ -60,7 +43,7 @@ stringData:
{{- range $url := . }} {{- range $url := . }}
- {{ . | quote }} - {{ . | quote }}
{{- end }} {{- end }}
{{- end }} {{- end -}}
{{- with $cm.entries }} {{- with $cm.entries }}
entries: entries:
@@ -72,7 +55,7 @@ stringData:
- season: {{ $season_entry.season }} - season: {{ $season_entry.season }}
anilist-id: {{ $season_entry.anilist_id }} anilist-id: {{ $season_entry.anilist_id }}
{{- end }} {{- end }}
{{- end }} {{- end -}}
{{- with $entry.synonyms }} {{- with $entry.synonyms }}
synonyms: synonyms:
{{- range $synonym := . }} {{- range $synonym := . }}
@@ -80,6 +63,6 @@ stringData:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end -}}
{{- end }} {{- end -}}
{{- end -}} {{- end -}}
@@ -1,15 +1,22 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }} {{- include "tc.v1.common.loader.init" . }}
{{/* Render secret */}} {{- $config := (include "plexanisync.config" . | fromYaml) }}
{{- include "plexanisync.secret" . }} {{- if $config -}}
{{- $_ := set .Values.configmap "config" $config -}}
{{- end -}}
{{- $secret := (include "plexanisync.secret" . | fromYaml) }}
{{- if $secret -}}
{{- $_ := set .Values.secret "secret" $secret -}}
{{- end -}}
{{- define "plexanisync.custom.mappings" -}} {{- define "plexanisync.custom.mappings" -}}
enabled: true enabled: true
type: secret type: secret
readOnly: true readOnly: true
defaultMode: "0600" defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-config-secret' objectName: secret
mountPath: /plexanisync/custom_mappings.yaml mountPath: /plexanisync/custom_mappings.yaml
subPath: custom_mappings.yaml subPath: custom_mappings.yaml
{{- end -}} {{- end -}}
@@ -19,4 +26,4 @@ subPath: custom_mappings.yaml
{{- end -}} {{- end -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.v1.common.loader.apply" . }}
+25 -22
View File
@@ -1,20 +1,18 @@
image: image:
repository: tccr.io/truecharts/plexanisync repository: tccr.io/truecharts/plexanisync
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: latest@sha256:f9db346735f4e316b0c363d1bf73826daa7d5feafed20c2d73bdb732ff2c798c tag: v1.3.25@sha256:f9db346735f4e316b0c363d1bf73826daa7d5feafed20c2d73bdb732ff2c798c
securityContext: securityContext:
readOnlyRootFilesystem: false container:
runAsNonRoot: false runAsNonRoot: false
readOnlyRootFilesystem: false
podSecurityContext: runAsUser: 0
runAsUser: 0 runAsGroup: 0
runAsGroup: 0
plexanisync: plexanisync:
interval: 3600 interval: 3600
plex: plex:
plex_section: anime_section:
[] []
# - section1 # - section1
# - section2 # - section2
@@ -50,9 +48,21 @@ custom_mappings:
# synonyms: # synonyms:
# - asfdasd # - asfdasd
envFrom: workload:
- secretRef: main:
name: '{{ include "tc.common.names.fullname" . }}-secret' podSpec:
containers:
main:
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
envFrom:
- configMapRef:
name: config
service: service:
main: main:
@@ -61,23 +71,16 @@ service:
main: main:
enabled: false enabled: false
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
persistence: persistence:
settings: settings:
enabled: true enabled: true
type: secret type: secret
readOnly: true readOnly: true
defaultMode: "0600" defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-config-secret' objectName: secret
mountPath: /plexanisync/settings.ini mountPath: /plexanisync/settings.ini
subPath: settings.ini subPath: settings.ini
portal: portal:
enabled: false open:
enabled: false