Skip to content

Commit

Permalink
Merge pull request #68 from nospi/fix-pdb-policy-v1-beta1
Browse files Browse the repository at this point in the history
updated references to deprecated policy/v1beta1 with policy/v1; re: issue #63
  • Loading branch information
itayankri authored Sep 15, 2023
2 parents 2e18f03 + a1fd9be commit 0e63904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions controllers/valhalla_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
autoscalingv1 "k8s.io/api/autoscaling/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -402,6 +402,6 @@ func (r *ValhallaReconciler) SetupWithManager(mgr ctrl.Manager) error {
Owns(&appsv1.Deployment{}).
Owns(&corev1.Service{}).
Owns(&autoscalingv1.HorizontalPodAutoscaler{}).
Owns(&policyv1beta1.PodDisruptionBudget{}).
Owns(&policyv1.PodDisruptionBudget{}).
Complete(r)
}
6 changes: 3 additions & 3 deletions internal/resource/pod_disruption_budget.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/itayankri/valhalla-operator/internal/status"
policyv1beta1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -20,7 +20,7 @@ func (builder *ValhallaResourceBuilder) PodDisruptionBudget() *PodDisruptionBudg
}

func (builder *PodDisruptionBudgetBuilder) Build() (client.Object, error) {
return &policyv1beta1.PodDisruptionBudget{
return &policyv1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: builder.Instance.ChildResourceName(HorizontalPodAutoscalerSuffix),
Namespace: builder.Instance.Namespace,
Expand All @@ -30,7 +30,7 @@ func (builder *PodDisruptionBudgetBuilder) Build() (client.Object, error) {

func (builder *PodDisruptionBudgetBuilder) Update(object client.Object) error {
name := builder.Instance.ChildResourceName(PodDisruptionBudgetSuffix)
pdb := object.(*policyv1beta1.PodDisruptionBudget)
pdb := object.(*policyv1.PodDisruptionBudget)

pdb.Spec.MinAvailable = builder.Instance.Spec.GetMinAvailable()
pdb.Spec.Selector = &metav1.LabelSelector{
Expand Down

0 comments on commit 0e63904

Please sign in to comment.