Skip to content

Commit

Permalink
Fix batch/v1beta1 deprecated (#118)
Browse files Browse the repository at this point in the history
I used the community-components submodule to deploy `s3-syncer` on cluster v1.28. I found batch/v1beta is deprecated. So I went with batch/v1. 

We can use Helm's `Capabilities.APIVersions.Has` feature to support both apiVersions to deploy them on any kubernetes version

Signed-off-by: Mohamed Rafraf <81432497+mohamed-rafraf@users.noreply.github.com>
  • Loading branch information
mohamed-rafraf committed Apr 11, 2024
1 parent b247852 commit fa165c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/rclone-s3-syncer/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{- range $job := $.Values.rcloneS3Syncer.job }}
---
{{- if .Capabilities.APIVersions.Has "batch/v1beta1/CronJob" }}
apiVersion: batch/v1beta1
{{- else }}
apiVersion: batch/v1
{{- end }}
kind: CronJob
metadata:
name: {{ $job.name }}
Expand Down

0 comments on commit fa165c5

Please sign in to comment.