Skip to content

Commit

Permalink
[stable/kube-downscaler] Cronjob apiVersion compliant post k8s v1.25 (#…
Browse files Browse the repository at this point in the history
…523)

* feat(kube-downscaler): update Cronjob for k8s 1.25 update

* update version injection

* updated README

* another run of readme

---------

Co-authored-by: Daniel Reyzek <daniel.reyzek@ecosio.com>
  • Loading branch information
dani-CO-CN and dani-rey authored Sep 21, 2023
1 parent 38d30d9 commit 64a827d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/kube-downscaler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: kube-downscaler
apiVersion: v1
version: "0.7.2"
version: "0.7.3"
appVersion: 23.2.0
description: Scale down Kubernetes deployments after work hours
keywords:
Expand Down
2 changes: 1 addition & 1 deletion stable/kube-downscaler/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kube-downscaler

![Version: 0.7.2](https://img.shields.io/badge/Version-0.7.2-informational?style=flat-square) ![AppVersion: 23.2.0](https://img.shields.io/badge/AppVersion-23.2.0-informational?style=flat-square)
![Version: 0.7.3](https://img.shields.io/badge/Version-0.7.3-informational?style=flat-square) ![AppVersion: 23.2.0](https://img.shields.io/badge/AppVersion-23.2.0-informational?style=flat-square)

Scale down Kubernetes deployments after work hours

Expand Down
11 changes: 11 additions & 0 deletions stable/kube-downscaler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ Return the appropriate apiVersion for RBAC APIs.
{{- end -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for Batch APIs.
*/}}
{{- define "batch.apiVersion" -}}
{{- if semverCompare "^1.21-0" .Capabilities.KubeVersion.GitVersion -}}
"batch/v1"
{{- else -}}
"batch/v1beta1"
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
Expand Down
2 changes: 1 addition & 1 deletion stable/kube-downscaler/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.resetAnnotationsCronjob.enabled -}}
apiVersion: batch/v1beta1
apiVersion: {{ template "batch.apiVersion" . }}
kind: CronJob
metadata:
name: {{ template "kube-downscaler.fullname" . }}-de-annotate
Expand Down

0 comments on commit 64a827d

Please sign in to comment.