Skip to content

Commit

Permalink
Correctly interpret .Capabilities.KubeVersion when it looks like a pr…
Browse files Browse the repository at this point in the history
…erelease

Signed-off-by: Tom Hayward <thayward@infoblox.com>
  • Loading branch information
kd7lxl authored and nschad committed May 5, 2023
1 parent 3fb5bda commit 5b9a4cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master / unreleased

* [DEPENDENCY] Update quay.io/cortexproject/cortex Docker tag to v1.15.0 #453
* [BUGFIX] Correctly interpret .Capabilities.KubeVersion when it looks like a prerelease #457

## 2.1.0 / 2023-03-17

Expand Down
4 changes: 2 additions & 2 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Create configuration for frontend memcached configuration
Determine the policy api version
*/}}
{{- define "cortex.pdbVersion" -}}
{{- if or (.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") (semverCompare ">=1.21" .Capabilities.KubeVersion.Version) -}}
{{- if or (.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") (semverCompare ">=1.21-0" .Capabilities.KubeVersion.Version) -}}
policy/v1
{{- else -}}
policy/v1beta1
Expand Down Expand Up @@ -153,7 +153,7 @@ Get volume of config secret of configMap
Get cortex hpa version by k8s version
*/}}
{{- define "cortex.hpaVersion" -}}
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler") (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) -}}
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler") (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) -}}
autoscaling/v2
{{- else -}}
autoscaling/v2beta2
Expand Down

0 comments on commit 5b9a4cc

Please sign in to comment.