Skip to content

Commit

Permalink
fix: fix for comparing semver for enterprise versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Aug 10, 2023
1 parent e50e010 commit 2675d75
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
7 changes: 7 additions & 0 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Nothing yet.

## 2.26.1

### Fixed

* Fix parsing enterprise tags (like e.g. `3.4.0.0`)
[#857](https://github.com/Kong/charts/pull/857)

## 2.26.0

### Improvements
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.26.0
version: 2.26.1
appVersion: "3.3"
dependencies:
- name: postgresql
Expand Down
14 changes: 14 additions & 0 deletions charts/kong/ci/test-enterprise-version-3.4.0.0-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ingressController:
enabled: false

image:
repository: kong/kong-gateway
tag: "3.4.0.0"

readinessProbe:
httpGet:
path: "/status"
port: status
scheme: HTTP
initialDelaySeconds: 1
periodSeconds: 1
17 changes: 15 additions & 2 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,22 @@ The name of the service used for the ingress controller's validation webhook
{{/* effectiveVersion takes an image dict from values.yaml. if .effectiveSemver is set, it returns that, else it returns .tag */}}
{{- define "kong.effectiveVersion" -}}
{{- if .effectiveSemver -}}
{{- .effectiveSemver -}}
{{- if regexMatch "[0-9]+.[0-9]+.[0-9]+" .effectiveSemver -}}
{{- regexFind "[0-9]+.[0-9]+.[0-9]+" .effectiveSemver -}}
{{- else if regexMatch "[0-9]+.[0-9]+" .effectiveSemver -}}
{{- regexFind "[0-9]+.[0-9]+" .effectiveSemver -}}
{{- else if regexMatch "[0-9]+" .effectiveSemver -}}
{{- regexFind "[0-9]+" .effectiveSemver -}}
{{- end -}}
{{- else -}}
{{- (trimSuffix "-redhat" .tag) -}}
{{- $tag := (trimSuffix "-redhat" .tag) -}}
{{- if regexMatch "[0-9]+.[0-9]+.[0-9]+" .tag -}}
{{- regexFind "[0-9]+.[0-9]+.[0-9]+" .tag -}}
{{- else if regexMatch "[0-9]+.[0-9]+" .tag -}}
{{- regexFind "[0-9]+.[0-9]+" .tag -}}
{{- else if regexMatch "[0-9]+" .tag -}}
{{- regexFind "[0-9]+" .tag -}}
{{- end -}}
{{- end -}}
{{- end -}}

Expand Down

0 comments on commit 2675d75

Please sign in to comment.