diff --git a/stable/ghost/Chart.yaml b/stable/ghost/Chart.yaml index 640c4e251c..b4fb6a5355 100644 --- a/stable/ghost/Chart.yaml +++ b/stable/ghost/Chart.yaml @@ -1,5 +1,5 @@ name: ghost -version: 5.2.1 +version: 5.3.0 appVersion: 2.2.2 description: A simple, powerful publishing platform that allows you to share your stories with the world diff --git a/stable/ghost/README.md b/stable/ghost/README.md index 3502cf09e4..511400796f 100644 --- a/stable/ghost/README.md +++ b/stable/ghost/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Ghost chart and the | Parameter | Description | Default | |----------------------------------|---------------------------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Ghost image registry | `docker.io` | | `image.repository` | Ghost Image name | `bitnami/ghost` | | `image.tag` | Ghost Image tag | `{VERSION}` | diff --git a/stable/ghost/requirements.lock b/stable/ghost/requirements.lock index 183adf180d..5dfebd4675 100644 --- a/stable/ghost/requirements.lock +++ b/stable/ghost/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.1.2 + version: 5.2.0 digest: sha256:b3053e73f5c114f55a794eccea2606cc9fe8a669eaab1716246994bbdd37a473 -generated: 2018-10-15T09:43:13.83847116Z +generated: 2018-10-16T08:47:50.749844+02:00 diff --git a/stable/ghost/templates/_helpers.tpl b/stable/ghost/templates/_helpers.tpl index 2c034934e5..219544d96b 100644 --- a/stable/ghost/templates/_helpers.tpl +++ b/stable/ghost/templates/_helpers.tpl @@ -63,3 +63,26 @@ Create chart name and version as used by the chart label. {{- define "ghost.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Ghost image name +*/}} +{{- define "ghost.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/stable/ghost/templates/deployment.yaml b/stable/ghost/templates/deployment.yaml index b5e83d2b0f..b2101eebac 100644 --- a/stable/ghost/templates/deployment.yaml +++ b/stable/ghost/templates/deployment.yaml @@ -43,7 +43,7 @@ spec: {{- end }} containers: - name: {{ template "ghost.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "ghost.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD diff --git a/stable/ghost/values.yaml b/stable/ghost/values.yaml index 0362fad36d..880c1d376c 100644 --- a/stable/ghost/values.yaml +++ b/stable/ghost/values.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Ghost image version ## ref: https://hub.docker.com/r/bitnami/ghost/tags/ ## @@ -97,6 +103,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true