From e554cfb6dad1ea6dde4a7c57acbceb59bd388bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Rodr=C3=ADguez=20Hern=C3=A1ndez?= Date: Thu, 18 Jul 2019 15:34:53 +0200 Subject: [PATCH] [stable/opencart] Implement again "Standardize 'fullname' and 'name' macros" (#15647) This reverts commit 8cddf1d0baea5176051a5e908f7cdaa60a28a1a7. Implement #15435 bumping a major version after #15601 Signed-off-by: Carlos Rodriguez Hernandez --- stable/opencart/Chart.yaml | 2 +- stable/opencart/README.md | 2 ++ stable/opencart/templates/_helpers.tpl | 8 ++++++++ stable/opencart/values.yaml | 8 ++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/stable/opencart/Chart.yaml b/stable/opencart/Chart.yaml index c47d222d3e..c101cdc414 100644 --- a/stable/opencart/Chart.yaml +++ b/stable/opencart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: opencart -version: 4.5.5 +version: 5.0.0 appVersion: 3.0.3-2 description: A free and open source e-commerce platform for online merchants. It provides a professional and reliable foundation for a successful online store. keywords: diff --git a/stable/opencart/README.md b/stable/opencart/README.md index 762977dcec..28ed772d39 100644 --- a/stable/opencart/README.md +++ b/stable/opencart/README.md @@ -56,6 +56,8 @@ The following table lists the configurable parameters of the OpenCart chart and | `image.tag` | OpenCart Image tag | `{TAG_NAME}` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `nameOverride` | String to partially override opencart.fullname template with a string (will prepend the release name) | `nil` | +| `fullnameOverride` | String to fully override opencart.fullname template with a string | `nil` | | `opencartHost` | OpenCart host to create application URLs | `nil` | | `service.type` | Kubernetes Service type | `LoadBalancer` | | `service.port` | Service HTTP port | `80` | diff --git a/stable/opencart/templates/_helpers.tpl b/stable/opencart/templates/_helpers.tpl index cccd57823e..b52bffbceb 100644 --- a/stable/opencart/templates/_helpers.tpl +++ b/stable/opencart/templates/_helpers.tpl @@ -11,9 +11,17 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "opencart.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} +{{- end -}} {{/* Create a default fully qualified app name. diff --git a/stable/opencart/values.yaml b/stable/opencart/values.yaml index 68c5e7d9e8..9daf9ccae5 100644 --- a/stable/opencart/values.yaml +++ b/stable/opencart/values.yaml @@ -26,6 +26,14 @@ image: # pullSecrets: # - myRegistryKeySecretName +## String to partially override opencart.fullname template (will maintain the release name) +## +# nameOverride: + +## String to fully override opencart.fullname template +## +# fullnameOverride: + ## OpenCart host to create application URLs ## ref: https://github.com/bitnami/bitnami-docker-opencart#configuration ##