Skip to content

Commit

Permalink
fix(volumes) reorder ifs and ends (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest authored Jan 26, 2023
1 parent 36f5684 commit 2abe80d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Unreleased


## 2.15.3

### Fixed

* Changed `ingressController.readinessProbe` to use `/readyz` to prevent pods from becoming ready and serving 404s prior to the `ingress-controller` first syncing config to the `proxy` [#716](https://github.com/Kong/charts/pull/716).
* Fixed incorrect `if` block order in volume mount templates.

## 2.15.2

Expand Down
2 changes: 1 addition & 1 deletion charts/kong/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maintainers:
name: kong
sources:
- https://github.com/Kong/charts/tree/main/charts/kong
version: 2.15.2
version: 2.15.3
appVersion: "3.1"
dependencies:
- name: postgresql
Expand Down
23 changes: 12 additions & 11 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -477,22 +477,23 @@ The name of the service used for the ingress controller's validation webhook
{{- end }}

{{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
{{- $dblessSourceCount := (add (.Values.dblessConfig.configMap | len | min 1) (.Values.dblessConfig.secret | len | min 1) (.Values.dblessConfig.config | len | min 1)) -}}
{{- if gt $dblessSourceCount 1 -}}
{{- fail "Ambiguous configuration: only one of of .Values.dblessConfig.configMap, .Values.dblessConfig.secret, and .Values.dblessConfig.config can be set." -}}
{{- $dblessSourceCount := (add (.Values.dblessConfig.configMap | len | min 1) (.Values.dblessConfig.secret | len | min 1) (.Values.dblessConfig.config | len | min 1)) -}}
{{- if gt $dblessSourceCount 1 -}}
{{- fail "Ambiguous configuration: only one of of .Values.dblessConfig.configMap, .Values.dblessConfig.secret, and .Values.dblessConfig.config can be set." -}}
- name: kong-custom-dbless-config-volume
{{- if .Values.dblessConfig.configMap }}
{{- if .Values.dblessConfig.configMap }}
configMap:
name: {{ .Values.dblessConfig.configMap }}
{{- else if .Values.dblessConfig.secret }}
{{- else if .Values.dblessConfig.secret }}
secret:
secretName: {{ .Values.dblessConfig.secret }}
{{- else }}
{{- else }}
configMap:
name: {{ template "kong.dblessConfig.fullname" . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{- if .Values.ingressController.admissionWebhook.enabled }}
- name: webhook-cert
secret:
Expand Down Expand Up @@ -551,16 +552,16 @@ The name of the service used for the ingress controller's validation webhook
{{- end }}
{{- end }}
{{- $dblessSourceCount := (add (.Values.dblessConfig.configMap | len | min 1) (.Values.dblessConfig.secret | len | min 1) (.Values.dblessConfig.config | len | min 1)) -}}
{{- if gt $dblessSourceCount 1 -}}
{{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
{{- if gt $dblessSourceCount 1 -}}
{{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off")) }}
- name: kong-custom-dbless-config-volume
mountPath: /kong_dbless/
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.secretVolumes }}
- name: {{ . }}
mountPath: /etc/secrets/{{ . }}
{{- end }}
{{- end }}
{{- range .Values.plugins.configMaps }}
{{- $mountPath := printf "/opt/kong/plugins/%s" .pluginName }}
- name: kong-plugin-{{ .pluginName }}
Expand Down

0 comments on commit 2abe80d

Please sign in to comment.