uppdate PodDisruptionBudget to policy/v1
package pxc
import (
- policyv1beta1 "k8s.io/api/policy/v1beta1"
+ policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api "github.com/percona/percona-xtradb-cluster-operator/pkg/apis/pxc/v1"
)
-func PodDisruptionBudget(spec *api.PodDisruptionBudgetSpec, labels map[string]string, namespace string) *policyv1beta1.PodDisruptionBudget {
- return &policyv1beta1.PodDisruptionBudget{
+func PodDisruptionBudget(spec *api.PodDisruptionBudgetSpec, labels map[string]string, namespace string) *policyv1.PodDisruptionBudget {
+ return &policyv1.PodDisruptionBudget{
TypeMeta: metav1.TypeMeta{
- APIVersion: "policy/v1beta1",
+ APIVersion: "policy/v1",
Kind: "PodDisruptionBudget",
},
ObjectMeta: metav1.ObjectMeta{
Name: labels["app.kubernetes.io/instance"] + "-" + labels["app.kubernetes.io/component"],
Namespace: namespace,
},
- Spec: policyv1beta1.PodDisruptionBudgetSpec{
+ Spec: policyv1.PodDisruptionBudgetSpec{
MinAvailable: spec.MinAvailable,
MaxUnavailable: spec.MaxUnavailable,
Selector: &metav1.LabelSelector{
