From 826595f0cc5487b9e7fcfb60727fe6404ae4ff50 Mon Sep 17 00:00:00 2001
From: Saswata Mukherjee <saswataminsta@yahoo.com>
Date: Tue, 30 Aug 2022 14:38:00 +0530
Subject: [PATCH] Change Receive PDB to policy/v1 (#284)

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
---
 CHANGELOG.md                                                    | 1 +
 Makefile                                                        | 2 +-
 .../manifests/thanos-receive-default-podDisruptionBudget.yaml   | 2 +-
 .../manifests/thanos-receive-region-1-podDisruptionBudget.yaml  | 2 +-
 jsonnet/kube-thanos/kube-thanos-receive.libsonnet               | 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 59242fdb..56fcf74c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
 ### Changed
 
 - [#279](https://github.com/thanos-io/kube-thanos/pull/279) Change `hashringConfigmapName` to `hashringConfigMapName` in Receive configuration.
+- [#284](https://github.com/thanos-io/kube-thanos/pull/284) Change Receive `PodDisruptionBudget` api version to `policy/v1`
 
 ### Added
 
diff --git a/Makefile b/Makefile
index 5b8182b2..3494fabf 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ MANIFESTS := manifests
 CRDSCHEMAS := .crdschemas
 TMP := tmp
 
-K8S_VERSION := 1.20.4
+K8S_VERSION := 1.21.0
 PROM_OPERATOR_VERSION := 0.46.0
 
 PIP  := pip3
diff --git a/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml b/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml
index 8734fb2d..799aca55 100644
--- a/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml
+++ b/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml
@@ -1,4 +1,4 @@
-apiVersion: policy/v1beta1
+apiVersion: policy/v1
 kind: PodDisruptionBudget
 metadata:
   name: thanos-receive-default
diff --git a/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml b/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml
index 9e51e1a2..f0c3bc18 100644
--- a/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml
+++ b/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml
@@ -1,4 +1,4 @@
-apiVersion: policy/v1beta1
+apiVersion: policy/v1
 kind: PodDisruptionBudget
 metadata:
   name: thanos-receive-region-1
diff --git a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet
index 0848eab3..5feddb90 100644
--- a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet
+++ b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet
@@ -255,7 +255,7 @@ function(params) {
   },
 
   podDisruptionBudget: if tr.config.podDisruptionBudgetMaxUnavailable >= 1 then {
-    apiVersion: 'policy/v1beta1',
+    apiVersion: 'policy/v1',
     kind: 'PodDisruptionBudget',
     metadata: {
       name: tr.config.name,