Skip to content

Commit

Permalink
fix: make semverCompare handle GKE versions and release 2.16.1 (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Feb 6, 2023
1 parent 1c5242f commit cf4be8e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 5 additions & 2 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog

## Unreleased
## 2.16.1

Nothing yet.
### Fixed

* serviceAccount projected volume is properly provisioned for GKE clusters >= 1.20.
[#735](https://github.com/Kong/charts/pull/735)

## 2.16.0

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.16.0
version: 2.16.1
appVersion: "3.1"
dependencies:
- name: postgresql
Expand Down
6 changes: 5 additions & 1 deletion charts/kong/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ spec:
{{- include "kong.userDefinedVolumes" . | nindent 8 -}}
{{- if (and (not .Values.deployment.serviceAccount.automountServiceAccountToken) (or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name)) }}
- name: {{ template "kong.serviceAccountTokenName" . }}
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
{{- /* Due to GKE versions (e.g. v1.23.15-gke.1900) we need to handle pre-release part of the version as well.
See the related documentation of semver module that Helm depends on for semverCompare:
https://github.com/Masterminds/semver#working-with-prerelease-versions
Related Helm issue: https://github.com/helm/helm/issues/3810 */}}
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version }}
projected:
sources:
- serviceAccountToken:
Expand Down
6 changes: 5 additions & 1 deletion charts/kong/templates/secret-sa-token.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{- if and (or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name) (semverCompare "<1.20" .Capabilities.KubeVersion.Version) }}
{{- /* Due to GKE versions (e.g. v1.23.15-gke.1900) we need to handle pre-release part of the version as well.
See the related documentation of semver module that Helm depends on for semverCompare:
https://github.com/Masterminds/semver#working-with-prerelease-versions
Related Helm issue: https://github.com/helm/helm/issues/3810 */}}
{{- if and (or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name) (semverCompare "<1.20.0-0" .Capabilities.KubeVersion.Version) }}
apiVersion: v1
kind: Secret
metadata:
Expand Down

0 comments on commit cf4be8e

Please sign in to comment.