File tree Expand file tree Collapse file tree 5 files changed +25
-4
lines changed
Expand file tree Collapse file tree 5 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apiVersion: v2
22name : k8s-image-swapper
33description : Mirror images into your own registry and swap image references automatically.
44type : application
5- version : 1.6.1
5+ version : 1.6.2
66appVersion : 1.4.1
77home : https://github.com/estahn/charts/tree/main/charts/k8s-image-swapper
88keywords :
@@ -15,7 +15,7 @@ maintainers:
1515 name : estahn
1616annotations :
1717 artifacthub.io/changes : |
18- - "Allow to set custom name for serviceAccount "
18+ - "Fixes deprecated policy api usage for pdb "
1919 artifacthub.io/images : |
2020 - name: k8s-image-webhook
2121 image: ghcr.io/estahn/k8s-image-swapper:1.4.1
Original file line number Diff line number Diff line change 11# k8s-image-swapper
22
3- ![ Version: 1.6.1 ] ( https://img.shields.io/badge/Version-1.6.1 -informational?style=flat-square ) ![ Type: application] ( https://img.shields.io/badge/Type-application-informational?style=flat-square ) ![ AppVersion: 1.4.1] ( https://img.shields.io/badge/AppVersion-1.4.1-informational?style=flat-square )
3+ ![ Version: 1.6.2 ] ( https://img.shields.io/badge/Version-1.6.2 -informational?style=flat-square ) ![ Type: application] ( https://img.shields.io/badge/Type-application-informational?style=flat-square ) ![ AppVersion: 1.4.1] ( https://img.shields.io/badge/AppVersion-1.4.1-informational?style=flat-square )
44
55Mirror images into your own registry and swap image references automatically.
66
@@ -39,6 +39,7 @@ Mirror images into your own registry and swap image references automatically.
3939| image.repository | string | ` "ghcr.io/estahn/k8s-image-swapper" ` | |
4040| image.tag | string | ` "" ` | |
4141| imagePullSecrets | list | ` [] ` | |
42+ | kubeVersionOverride | string | ` "" ` | |
4243| nameOverride | string | ` "" ` | |
4344| nodeSelector | object | ` {} ` | |
4445| patch.enabled | bool | ` true ` | |
Original file line number Diff line number Diff line change @@ -70,3 +70,21 @@ Create the name of the service account to use
7070{{- default " default" .Values.serviceAccount.name }}
7171{{- end }}
7272{{- end }}
73+
74+ {{/*
75+ Return the appropriate apiVersion for pod disruption budget
76+ */ }}
77+ {{- define " k8s-image-swapper.podDisruptionBudget.apiVersion" -}}
78+ {{- if semverCompare " <1.21-0" (include " k8s-image-swapper.kubeVersion" $ ) -}}
79+ {{- print " policy/v1beta1" -}}
80+ {{- else -}}
81+ {{- print " policy/v1" -}}
82+ {{- end -}}
83+ {{- end -}}
84+
85+ {{/*
86+ Return the target Kubernetes version
87+ */ }}
88+ {{- define " k8s-image-swapper.kubeVersion" -}}
89+ {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride }}
90+ {{- end -}}
Original file line number Diff line number Diff line change 11{{- if .Values.pdb.enabled }}
2- apiVersion : policy/v1beta1
2+ apiVersion : {{ template "k8s-image-swapper.podDisruptionBudget.apiVersion" . }}
33kind : PodDisruptionBudget
44metadata :
55 name : {{ include "k8s-image-swapper.fullname" . }}
Original file line number Diff line number Diff line change 1212
1313containerPort : 8443
1414
15+ kubeVersionOverride : " "
16+
1517imagePullSecrets : []
1618nameOverride : " "
1719fullnameOverride : " "
You can’t perform that action at this time.
0 commit comments