diff --git a/stable/moodle/Chart.yaml b/stable/moodle/Chart.yaml index 81ba498778..f79df1979f 100644 --- a/stable/moodle/Chart.yaml +++ b/stable/moodle/Chart.yaml @@ -1,5 +1,5 @@ name: moodle -version: 3.1.0 +version: 3.2.0 appVersion: 3.5.2 description: Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised diff --git a/stable/moodle/README.md b/stable/moodle/README.md index 8b5784d9c1..aa3908f565 100644 --- a/stable/moodle/README.md +++ b/stable/moodle/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Moodle chart and th | Parameter | Description | Default | |---------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Moodle image registry | `docker.io` | | `image.repository` | Moodle Image name | `bitnami/moodle` | | `image.tag` | Moodle Image tag | `{VERSION}` | diff --git a/stable/moodle/requirements.lock b/stable/moodle/requirements.lock index d4ea98e976..be4259299b 100644 --- a/stable/moodle/requirements.lock +++ b/stable/moodle/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:42:15.186850414+02:00 +generated: 2018-10-16T08:48:49.994683+02:00 diff --git a/stable/moodle/templates/_helpers.tpl b/stable/moodle/templates/_helpers.tpl index 6b8934c9aa..787d96c175 100644 --- a/stable/moodle/templates/_helpers.tpl +++ b/stable/moodle/templates/_helpers.tpl @@ -36,4 +36,27 @@ Create chart name and version as used by the chart label. */}} {{- define "moodle.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Moodle image name +*/}} +{{- define "moodle.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/moodle/templates/deployment.yaml b/stable/moodle/templates/deployment.yaml index 03817dad28..0da16a1bab 100644 --- a/stable/moodle/templates/deployment.yaml +++ b/stable/moodle/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: {{- end }} containers: - name: {{ template "moodle.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "moodle.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index e1291c8b4d..ec8a9fc6d6 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/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 Moodle image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## @@ -66,6 +72,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