1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-28 18:38:40 +00:00

Fix handling of kyverno-policies version check when port in image tag (#4042)

* Fix handling of kyverno-policies version check when port in image tag
Fixes #4031

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Add release notes for chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix release notes and use splitList

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
This commit is contained in:
treydock 2022-05-31 11:02:19 -04:00 committed by GitHub
parent 18ae9c7d6d
commit 566eae7d94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -25,3 +25,5 @@ annotations:
artifacthub.io/changes: |
- kind: added
description: Support for artifacthub.io/changes annotation
- kind: fixed
description: Fix Kyverno version check when image tag contains registry port number

View file

@ -59,7 +59,7 @@ helm.sh/chart: {{ template "kyverno-policies.chart" . }}
{{- $version := "" -}}
{{- with (lookup "apps/v1" "Deployment" .Release.Namespace "kyverno") -}}
{{- with (first .spec.template.spec.containers) -}}
{{- $imageTag := (split ":" .image)._1 -}}
{{- $imageTag := (last (splitList ":" .image)) -}}
{{- $version = trimPrefix "v" $imageTag -}}
{{- end -}}
{{- end -}}