From a565cac268f0b42246e9fef67958b36bd4116e5f Mon Sep 17 00:00:00 2001 From: Amanda Cameron Date: Fri, 20 Jan 2017 15:05:33 -0500 Subject: [PATCH 1/5] Convert chart factorio to use the recommended pvc patterns --- stable/factorio/templates/mods-pvc.yaml | 9 ++++++++- stable/factorio/templates/saves-pvc.yaml | 9 ++++++++- stable/factorio/values.yaml | 5 ++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/stable/factorio/templates/mods-pvc.yaml b/stable/factorio/templates/mods-pvc.yaml index b83c14e7b07b..fa682a859775 100644 --- a/stable/factorio/templates/mods-pvc.yaml +++ b/stable/factorio/templates/mods-pvc.yaml @@ -9,7 +9,14 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- if .Values.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{ else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} + {{- range $key, $value := .Values.persistence.annotations }} + {{ $key }}: {{ $value }} + {{- end }} spec: accessModes: - ReadWriteOnce diff --git a/stable/factorio/templates/saves-pvc.yaml b/stable/factorio/templates/saves-pvc.yaml index 01a4b2f588d9..20e9bbc183c8 100644 --- a/stable/factorio/templates/saves-pvc.yaml +++ b/stable/factorio/templates/saves-pvc.yaml @@ -9,7 +9,14 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- if .Values.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{ else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} + {{- range $key, $value := .Values.persistence.annotations }} + {{ $key }}: {{ $value }} + {{- end }} spec: accessModes: - ReadWriteOnce diff --git a/stable/factorio/values.yaml b/stable/factorio/values.yaml index 680c9febd309..54841287601f 100644 --- a/stable/factorio/values.yaml +++ b/stable/factorio/values.yaml @@ -48,7 +48,10 @@ factorio: password: your.password persistence: - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: savedGames: # Set this to false if you don't care to persist saved games between restarts. enabled: true From dd4a859dd6db22fa3bc6b5f12f36be94d533d7d4 Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Fri, 27 Jan 2017 15:29:06 -0800 Subject: [PATCH 2/5] Update mods-pvc.yaml --- stable/factorio/templates/mods-pvc.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stable/factorio/templates/mods-pvc.yaml b/stable/factorio/templates/mods-pvc.yaml index fa682a859775..46bee955b438 100644 --- a/stable/factorio/templates/mods-pvc.yaml +++ b/stable/factorio/templates/mods-pvc.yaml @@ -11,12 +11,9 @@ metadata: annotations: {{- if .Values.persistence.storageClass }} volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} - {{ else }} + {{- else }} volume.alpha.kubernetes.io/storage-class: default {{- end }} - {{- range $key, $value := .Values.persistence.annotations }} - {{ $key }}: {{ $value }} - {{- end }} spec: accessModes: - ReadWriteOnce From c2bd71dfb843392316192952498686b895dd10e8 Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Fri, 27 Jan 2017 15:29:19 -0800 Subject: [PATCH 3/5] Update saves-pvc.yaml --- stable/factorio/templates/saves-pvc.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stable/factorio/templates/saves-pvc.yaml b/stable/factorio/templates/saves-pvc.yaml index 20e9bbc183c8..9415bb4f0c8f 100644 --- a/stable/factorio/templates/saves-pvc.yaml +++ b/stable/factorio/templates/saves-pvc.yaml @@ -11,12 +11,9 @@ metadata: annotations: {{- if .Values.persistence.storageClass }} volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} - {{ else }} + {{- else }} volume.alpha.kubernetes.io/storage-class: default {{- end }} - {{- range $key, $value := .Values.persistence.annotations }} - {{ $key }}: {{ $value }} - {{- end }} spec: accessModes: - ReadWriteOnce From f15ad5b12178cd4f01bbcecd3bfbb9404329c5b8 Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Fri, 27 Jan 2017 15:31:02 -0800 Subject: [PATCH 4/5] Update Chart.yaml --- stable/factorio/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/factorio/Chart.yaml b/stable/factorio/Chart.yaml index 25acf33f2318..e17b0b1dd6a6 100755 --- a/stable/factorio/Chart.yaml +++ b/stable/factorio/Chart.yaml @@ -1,5 +1,5 @@ name: factorio -version: 0.1.2 +version: 0.1.3 description: Factorio dedicated server. keywords: - game From b5e805965c417ea99cecb0a54cd989fb8f2e2a25 Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Fri, 27 Jan 2017 15:54:23 -0800 Subject: [PATCH 5/5] Update _helpers.tpl --- stable/factorio/templates/_helpers.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stable/factorio/templates/_helpers.tpl b/stable/factorio/templates/_helpers.tpl index 234480de714c..f0d83d2edba6 100644 --- a/stable/factorio/templates/_helpers.tpl +++ b/stable/factorio/templates/_helpers.tpl @@ -3,14 +3,14 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}}