From 5b045a5088383ba1b59b21de7579554d9b657ac5 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:19:45 +0200 Subject: [PATCH] plex - take care of cases that envs are for UID/GID are already set (#2109) --- library/ix-dev/charts/plex/Chart.yaml | 2 +- library/ix-dev/charts/plex/migrations/migrate | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/ix-dev/charts/plex/Chart.yaml b/library/ix-dev/charts/plex/Chart.yaml index 99eca1c211..6a0ac195da 100644 --- a/library/ix-dev/charts/plex/Chart.yaml +++ b/library/ix-dev/charts/plex/Chart.yaml @@ -3,7 +3,7 @@ description: Plex is a media server that allows you to stream your media to any annotations: title: Plex type: application -version: 2.0.0 +version: 2.0.1 apiVersion: v2 appVersion: 1.32.8.7639 kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/charts/plex/migrations/migrate b/library/ix-dev/charts/plex/migrations/migrate index 19956bffdb..80c8ee6612 100755 --- a/library/ix-dev/charts/plex/migrations/migrate +++ b/library/ix-dev/charts/plex/migrations/migrate @@ -49,15 +49,17 @@ def migrate_common_lib(values): 'plexID': { # We didn't have exposed this on UI the default # set by the container is 1000, so we will use that - 'user': 1000, - 'group': 1000, + # if the environmentVariables contains PLEX_UID/PLEX_GID use that + 'user': next((e['value'] for e in values.get('environmentVariables', []) if e['name'] == 'PLEX_UID'), 1000), + 'group': next((e['value'] for e in values.get('environmentVariables', []) if e['name'] == 'PLEX_GID'), 1000), }, # Migrate Config 'TZ': values['timezone'], 'plexConfig': { 'imageSelector': 'plexPassImage' if values['enablePlexPass'] else 'image', 'claimToken': values['claimToken'], - 'additionalEnvs': values.get('environmentVariables', []), + # Filter out the PLEX_UID and PLEX_GID + 'additionalEnvs': [e for e in values.get('environmentVariables', []) if e['name'] not in ['PLEX_UID', 'PLEX_GID'] ], }, 'plexGPU': values.get('gpuConfiguration', {}), # Migrate Storage