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 16:44:31 -04:00
committed by GitHub
parent 7f3fd03c58
commit e974a01cb3
7 changed files with 66 additions and 66 deletions

View File

@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: "latest"
appVersion: "1.3.25"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
version: 12.14.6
deprecated: false
description: Plex to AniList Sync.
home: https://truecharts.org/charts/incubator/plexanisync
@@ -22,7 +22,7 @@ sources:
- https://github.com/RickDB/PlexAniSync
- https://github.com/RickDB/PlexAniSync/pkgs/container/plexanisync
type: application
version: 2.0.0
version: 3.0.0
annotations:
truecharts.org/catagories: |
- media

View File

@@ -4,13 +4,13 @@ questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
- variable: plexanisync
group: App Configuration
label: PlexAniSync Configuration
@@ -31,16 +31,16 @@ questions:
additional_attrs: true
type: dict
attrs:
- variable: plex_section
label: Plex Section
- variable: anime_section
label: Anime Section
description: The libraries where your anime resides.
schema:
type: list
required: true
default: []
items:
- variable: plex_section_library_entry
label: Plex Section Library Entry
- variable: anime_section_library_entry
label: Anime Section Library Entry
description: Single library per entry.
schema:
type: string
@@ -227,14 +227,13 @@ questions:
type: string
required: true
default: ""
# Include{containerConfig}
# Include{podOptions}
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceList}
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"

View File

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

View File

@@ -0,0 +1,7 @@
{{- define "plexanisync.config" -}}
{{- $pas := .Values.plexanisync }}
enabled: true
data:
SETTINGS_FILE: {{ .Values.persistence.settings.mountPath }}
INTERVAL: {{ $pas.interval | quote }}
{{- end -}}

View File

@@ -1,31 +1,13 @@
{{/* Define the secret */}}
{{- define "plexanisync.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }}
{{- $secretConfigName := printf "%s-config-secret" (include "tc.common.names.fullname" .) }}
{{- $pas := .Values.plexanisync }}
{{- $pas := .Values.plexanisync -}}
{{- $cm := .Values.custom_mappings }}
---
apiVersion: v1
kind: Secret
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:
enabled: true
data:
settings.ini: |
[PLEX]
anime_section = {{ join "|" $pas.plex.plex_section }}
anime_section = {{ join "|" $pas.plex.anime_section }}
authentication_method = {{ $pas.plex.plex_auth_method }}
@@ -52,6 +34,7 @@ stringData:
skip_list_update = {{ ternary "True" "False" $pas.anilist.skip_list_update }}
username = {{ $pas.anilist.ani_username }}
log_failed_matches = {{ ternary "True" "False" $pas.anilist.log_failed_matches }}
custom_mappings.yaml: |
# https://github.com/RickDB/PlexAniSync/blob/master/custom_mappings.yaml.example
{{- if $cm }}
@@ -60,7 +43,7 @@ stringData:
{{- range $url := . }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- end -}}
{{- with $cm.entries }}
entries:
@@ -72,7 +55,7 @@ stringData:
- season: {{ $season_entry.season }}
anilist-id: {{ $season_entry.anilist_id }}
{{- end }}
{{- end }}
{{- end -}}
{{- with $entry.synonyms }}
synonyms:
{{- range $synonym := . }}
@@ -80,6 +63,6 @@ stringData:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@@ -1,15 +1,22 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{- include "tc.v1.common.loader.init" . }}
{{/* Render secret */}}
{{- include "plexanisync.secret" . }}
{{- $config := (include "plexanisync.config" . | fromYaml) }}
{{- 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" -}}
enabled: true
type: secret
readOnly: true
defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-config-secret'
objectName: secret
mountPath: /plexanisync/custom_mappings.yaml
subPath: custom_mappings.yaml
{{- end -}}
@@ -19,4 +26,4 @@ subPath: custom_mappings.yaml
{{- end -}}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
{{ include "tc.v1.common.loader.apply" . }}

View File

@@ -1,20 +1,18 @@
image:
repository: tccr.io/truecharts/plexanisync
pullPolicy: IfNotPresent
tag: latest@sha256:f9db346735f4e316b0c363d1bf73826daa7d5feafed20c2d73bdb732ff2c798c
tag: v1.3.25@sha256:f9db346735f4e316b0c363d1bf73826daa7d5feafed20c2d73bdb732ff2c798c
securityContext:
readOnlyRootFilesystem: false
runAsNonRoot: false
podSecurityContext:
runAsUser: 0
runAsGroup: 0
container:
runAsNonRoot: false
readOnlyRootFilesystem: false
runAsUser: 0
runAsGroup: 0
plexanisync:
interval: 3600
plex:
plex_section:
anime_section:
[]
# - section1
# - section2
@@ -50,9 +48,21 @@ custom_mappings:
# synonyms:
# - asfdasd
envFrom:
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-secret'
workload:
main:
podSpec:
containers:
main:
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
envFrom:
- configMapRef:
name: config
service:
main:
@@ -61,23 +71,16 @@ service:
main:
enabled: false
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
persistence:
settings:
enabled: true
type: secret
readOnly: true
defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-config-secret'
objectName: secret
mountPath: /plexanisync/settings.ini
subPath: settings.ini
portal:
enabled: false
open:
enabled: false