[stable/nats] Add global registry option (#8462)

* [stable/nats] Add global registry option

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Fix trailing space

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>
This commit is contained in:
Carlos Rodríguez Hernández
2018-10-16 02:11:32 -07:00
committed by k8s-ci-robot
parent ea454d88df
commit 95fd1381b1
5 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: nats
version: 1.0.3
version: 1.1.0
appVersion: 1.3.0
description: An open-source, cloud-native messaging system
keywords:
+1
View File
@@ -47,6 +47,7 @@ The following table lists the configurable parameters of the NATS chart and thei
| Parameter | Description | Default |
|--------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------|
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `image.registry` | NATS image registry | `docker.io` |
| `image.repository` | NATS Image name | `bitnami/nats` |
| `image.tag` | NATS Image tag | `{VERSION}` |
+17 -2
View File
@@ -21,11 +21,26 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}
{{/*
Return the proper image name
Return the proper Nats image name
*/}}
{{- define "nats.image" -}}
{{- $registryName := .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $tag := .Values.image.tag | toString -}}
{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}}
{{/*
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 -}}
{{/*
+6
View File
@@ -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 NATS image version
## ref: https://hub.docker.com/r/bitnami/nats/tags/
##
+6
View File
@@ -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 NATS image version
## ref: https://hub.docker.com/r/bitnami/nats/tags/
##