From b95324edaac47b253bbc6999816d77a7e3682503 Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 24 Oct 2024 00:09:06 -0400 Subject: [PATCH] Add label support to the data-pvc Longhorn uses labels to find volumes to backup, plus having labels makes sense anyway Add values field for data-dir labels Add data-pvc labels field to README Bump Chart version number to 2.0.2 --- charts/factorio-server-charts/Chart.yaml | 2 +- charts/factorio-server-charts/README.md | 1 + charts/factorio-server-charts/templates/datadir-pvc.yaml | 3 +++ charts/factorio-server-charts/values.yaml | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/factorio-server-charts/Chart.yaml b/charts/factorio-server-charts/Chart.yaml index 9d41726..5905d9e 100644 --- a/charts/factorio-server-charts/Chart.yaml +++ b/charts/factorio-server-charts/Chart.yaml @@ -20,7 +20,7 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.0.1 +version: 2.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/factorio-server-charts/README.md b/charts/factorio-server-charts/README.md index be0aef5..9865637 100644 --- a/charts/factorio-server-charts/README.md +++ b/charts/factorio-server-charts/README.md @@ -236,6 +236,7 @@ If you do run into any issues with mods, I will try to work with you on finding | `persistence.dataDir.existingClaim` | The name of an existing PVC to use for persistence | | | `persistence.storageClassName` | Persistent Volume storage class | `""` | | `persistence.annotations` | Persistent Volume Claim annotations | `{}` | +| `persistence.lables` | Persistent Volume Claim labels | `{}` | ### Factorio Parameters diff --git a/charts/factorio-server-charts/templates/datadir-pvc.yaml b/charts/factorio-server-charts/templates/datadir-pvc.yaml index 5c93f7f..43a6213 100644 --- a/charts/factorio-server-charts/templates/datadir-pvc.yaml +++ b/charts/factorio-server-charts/templates/datadir-pvc.yaml @@ -6,6 +6,9 @@ metadata: name: {{ template "factorio-server-charts.fullname" . }}-datadir labels: app: "{{ template "factorio-server-charts.fullname" . }}-{{ .Chart.Version }}" + {{- if .Values.persistence.labels }} + {{ toYaml .Values.persistence.labels | indent 4 }} + {{- end }} {{- if .Values.persistence.annotations }} annotations: {{ toYaml .Values.persistence.annotations | indent 4 }} diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index bffa9ed..ac6a91a 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -106,6 +106,7 @@ affinity: {} ## @extra persistence.dataDir.existingClaim The name of an existing PVC to use for persistence ## @param persistence.storageClassName Persistent Volume storage class ## @param persistence.annotations Persistent Volume Claim annotations +## @param persistence.labels Persistent Volume Claim labels ## Sets the data persistence volume configuration ## IMPORTANT: If you do not setup a PV all your savegames will be lost on pod recreation or helm upgrade persistence: @@ -118,6 +119,8 @@ persistence: storageClassName: "" ## If you have annotations to spin up a PV i.e. the location. Remove the curly braces annotations: {} + ## If you have additional labels to apply to the volume + labels: {} #### Factorio application configuration ####