Skip to content

Commit

Permalink
fix: make semverCompare handle GKE versions
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Feb 6, 2023
1 parent 1c5242f commit fb2b9b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## Unreleased

Nothing yet.
### Fixed

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

## 2.16.0

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 fb2b9b1

Please sign in to comment.