From 0f9aa42a0a256c178a6ddd52a70f2ccda113da6f Mon Sep 17 00:00:00 2001 From: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:18:40 -0400 Subject: [PATCH] migrate(plex-meta-manager) migrate plex-meta-manager to new common (#10088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** migrate app to new common and update version ⚒️ Fixes # **⚙️ 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?** **📃 Notes:** initContainers, cant say if this is done correctly. **✔️ 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> --- charts/incubator/plex-meta-manager/Chart.yaml | 6 +- .../plex-meta-manager/questions.yaml | 40 +++++---- .../plex-meta-manager/templates/NOTES.txt | 1 + .../plex-meta-manager/templates/_secret.tpl | 13 +-- .../plex-meta-manager/templates/common.yaml | 11 ++- .../incubator/plex-meta-manager/values.yaml | 87 ++++++++++--------- 6 files changed, 81 insertions(+), 77 deletions(-) create mode 100644 charts/incubator/plex-meta-manager/templates/NOTES.txt diff --git a/charts/incubator/plex-meta-manager/Chart.yaml b/charts/incubator/plex-meta-manager/Chart.yaml index c77bb791d2a..ef16cf4e5eb 100644 --- a/charts/incubator/plex-meta-manager/Chart.yaml +++ b/charts/incubator/plex-meta-manager/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: "1.18.3" +appVersion: "1.19.0" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 12.14.6 deprecated: false description: Python script to update metadata and automatically build collections. home: https://truecharts.org/charts/incubator/plex-meta-manager @@ -20,7 +20,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/plex-meta-manager - https://github.com/meisnate12/Plex-Meta-Manager type: application -version: 2.0.14 +version: 3.0.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/incubator/plex-meta-manager/questions.yaml b/charts/incubator/plex-meta-manager/questions.yaml index a4f9dfaa4f9..4bb150ceaa7 100644 --- a/charts/incubator/plex-meta-manager/questions.yaml +++ b/charts/incubator/plex-meta-manager/questions.yaml @@ -58,7 +58,9 @@ questions: schema: type: boolean default: true + # Include{containerConfig} +# Include{podOptions} # Include{serviceExpertRoot} # Include{serviceExpert} # Include{serviceList} @@ -73,28 +75,28 @@ questions: # Include{persistenceBasic} # Include{persistenceList} -# 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 +# Include{securityContextRoot} + - 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} diff --git a/charts/incubator/plex-meta-manager/templates/NOTES.txt b/charts/incubator/plex-meta-manager/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/plex-meta-manager/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/plex-meta-manager/templates/_secret.tpl b/charts/incubator/plex-meta-manager/templates/_secret.tpl index dd893edb7f4..c0277bd8933 100644 --- a/charts/incubator/plex-meta-manager/templates/_secret.tpl +++ b/charts/incubator/plex-meta-manager/templates/_secret.tpl @@ -1,16 +1,9 @@ {{/* Define the secret */}} {{- define "pmm.secret" -}} -{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }} -{{- $pmm := .Values.pmm -}} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ $secretName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: +{{- $pmm := .Values.pmm }} +enabled: true +data: {{/* PMM */}} PMM_CONFIG: "/config/config.yml" {{- if not $pmm.run }} diff --git a/charts/incubator/plex-meta-manager/templates/common.yaml b/charts/incubator/plex-meta-manager/templates/common.yaml index 57657f9107d..2c8b16b6de4 100644 --- a/charts/incubator/plex-meta-manager/templates/common.yaml +++ b/charts/incubator/plex-meta-manager/templates/common.yaml @@ -1,8 +1,11 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} -{{/* Render secret */}} -{{- include "pmm.secret" . }} +{{/* Render secret for pmm */}} +{{- $secret := include "pmm.secret" . | fromYaml -}} +{{- if $secret -}} + {{- $_ := set .Values.secret "secret" $secret -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/plex-meta-manager/values.yaml b/charts/incubator/plex-meta-manager/values.yaml index a2643dd06b7..1db82401260 100644 --- a/charts/incubator/plex-meta-manager/values.yaml +++ b/charts/incubator/plex-meta-manager/values.yaml @@ -1,15 +1,21 @@ image: repository: tccr.io/truecharts/plex-meta-manager pullPolicy: IfNotPresent - tag: 1.18.3@sha256:d8adb30906dbeffae964364bb7b98372b06283c8e9ab3e7624eab2265478e8fc + tag: v1.19.0@sha256:302c3b396f4af2cb789cb36aa7540bc501a7d4aeb108090f7b6aff8e85680110 securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + runAsNonRoot: false + readOnlyRootFilesystem: false + runAsUser: 0 + runAsGroup: 0 -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 +service: + main: + enabled: false + ports: + main: + enabled: false pmm: run: false @@ -19,46 +25,45 @@ pmm: # plex_url: "" # plex_token: "" -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-secret' - -service: +workload: main: - enabled: false - ports: - main: - enabled: false - -probes: - liveness: - enabled: false - readiness: - enabled: false - startup: - enabled: false + podSpec: + initContainers: + create-init-config-file: + enabled: true + type: init + imageSelector: "image" + command: + - /bin/sh + - -c + args: + - | + echo "Creating config.yml file..." + if [ -f /config/config.yml ]; then + echo "Config file exists! Skipping..." + else + echo "Config file is missing, getting a new one!" + curl -fLvo /config/config.yml https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/config/config.yml.template || (echo "Downloading config file, FAILED..." && exit 1) + fi + containers: + main: + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + envFrom: + - secretRef: + name: "secret" persistence: config: enabled: true mountPath: /config - -initContainers: - 1-create-init-config-file: - image: "{{ .Values.ubuntuImage.repository }}:{{ .Values.ubuntuImage.tag }}" - volumeMounts: - - name: config - mountPath: "/config" - command: ["/bin/sh", "-c"] - args: - - |- - echo "Creating config.yml file..." - if [ -f /config/config.yml ]; then - echo "Config file exists!, Skipping..." - else - echo "Config file is missing, getting a new one!" - curl -fLvo /config/config.yml https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/config/config.yml.template || ( echo "Downloading config file, FAILED..." && exit 1 ) - fi + targetSelectAll: true portal: - enabled: false + open: + enabled: false