Skip to content

Commit

Permalink
update autoscaling and pdb APIs (#127)
Browse files Browse the repository at this point in the history
* update pdb policy to PolicyV1

Signed-off-by: Sahil Badla <sahil_badla@intuit.com>

* update unit tests

Signed-off-by: Sahil Badla <sahil_badla@intuit.com>

---------

Signed-off-by: Sahil Badla <sahil_badla@intuit.com>
Co-authored-by: Sahil Badla <sahil_badla@intuit.com>
  • Loading branch information
sbadla1 and sahilbadla authored Nov 21, 2023
1 parent 48e362c commit 4173a54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/kube/structured/structured.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ func ResourceInNamespace(kubeClientset kubernetes.Interface, resourceType, name,
case "service":
_, err = kubeClientset.CoreV1().Services(namespace).Get(context.Background(), name, metav1.GetOptions{})
case "hpa", "horizontalpodautoscaler":
_, err = kubeClientset.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Get(context.Background(), name, metav1.GetOptions{})
_, err = kubeClientset.AutoscalingV2().HorizontalPodAutoscalers(namespace).Get(context.Background(), name, metav1.GetOptions{})
case "pdb", "poddisruptionbudget":
_, err = kubeClientset.PolicyV1beta1().PodDisruptionBudgets(namespace).Get(context.Background(), name, metav1.GetOptions{})
_, err = kubeClientset.PolicyV1().PodDisruptionBudgets(namespace).Get(context.Background(), name, metav1.GetOptions{})
case "sa", "serviceaccount":
_, err = kubeClientset.CoreV1().ServiceAccounts(namespace).Get(context.Background(), name, metav1.GetOptions{})
default:
Expand Down
8 changes: 4 additions & 4 deletions pkg/kube/structured/structured_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/keikoproj/kubedog/internal/util"
"github.com/keikoproj/kubedog/pkg/kube/common"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/autoscaling/v2beta2"
v2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
v1beta1 "k8s.io/api/policy/v1beta1"
v1 "k8s.io/api/policy/v1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -693,15 +693,15 @@ func getResourceWithAll(t *testing.T, resourceType, name, namespace, label strin
},
}
case "hpa", hpaType:
return &v2beta2.HorizontalPodAutoscaler{
return &v2.HorizontalPodAutoscaler{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: labels,
},
}
case "pdb", pdbType:
return &v1beta1.PodDisruptionBudget{
return &v1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Expand Down

0 comments on commit 4173a54

Please sign in to comment.