mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
remove PDB v1beta1 usage where v1 is equivalent
This commit is contained in:
parent
233e0cb8c3
commit
d323a30f60
@ -466,7 +466,7 @@ func newCustomResourceDefinition() *apiextensionsv1.CustomResourceDefinition {
|
|||||||
|
|
||||||
func waitPDBStable(ctx context.Context, t *testing.T, clientSet clientset.Interface, podNum int32, ns, pdbName string) {
|
func waitPDBStable(ctx context.Context, t *testing.T, clientSet clientset.Interface, podNum int32, ns, pdbName string) {
|
||||||
if err := wait.PollImmediate(2*time.Second, 60*time.Second, func() (bool, error) {
|
if err := wait.PollImmediate(2*time.Second, 60*time.Second, func() (bool, error) {
|
||||||
pdb, err := clientSet.PolicyV1beta1().PodDisruptionBudgets(ns).Get(ctx, pdbName, metav1.GetOptions{})
|
pdb, err := clientSet.PolicyV1().PodDisruptionBudgets(ns).Get(ctx, pdbName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
|
|||||||
|
|
||||||
close(errCh)
|
close(errCh)
|
||||||
var errList []error
|
var errList []error
|
||||||
if err := clientSet.PolicyV1beta1().PodDisruptionBudgets(ns.Name).Delete(context.TODO(), pdb.Name, deleteOption); err != nil {
|
if err := clientSet.PolicyV1().PodDisruptionBudgets(ns.Name).Delete(context.TODO(), pdb.Name, deleteOption); err != nil {
|
||||||
errList = append(errList, fmt.Errorf("Failed to delete PodDisruptionBudget: %v", err))
|
errList = append(errList, fmt.Errorf("Failed to delete PodDisruptionBudget: %v", err))
|
||||||
}
|
}
|
||||||
for err := range errCh {
|
for err := range errCh {
|
||||||
@ -220,7 +220,7 @@ func TestTerminalPodEviction(t *testing.T) {
|
|||||||
|
|
||||||
waitPDBStable(t, clientSet, 1, ns.Name, pdb.Name)
|
waitPDBStable(t, clientSet, 1, ns.Name, pdb.Name)
|
||||||
|
|
||||||
pdbList, err := clientSet.PolicyV1beta1().PodDisruptionBudgets(ns.Name).List(context.TODO(), metav1.ListOptions{})
|
pdbList, err := clientSet.PolicyV1().PodDisruptionBudgets(ns.Name).List(context.TODO(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error while listing pod disruption budget")
|
t.Fatalf("Error while listing pod disruption budget")
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ func TestTerminalPodEviction(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Eviction of pod failed %v", err)
|
t.Fatalf("Eviction of pod failed %v", err)
|
||||||
}
|
}
|
||||||
pdbList, err = clientSet.PolicyV1beta1().PodDisruptionBudgets(ns.Name).List(context.TODO(), metav1.ListOptions{})
|
pdbList, err = clientSet.PolicyV1().PodDisruptionBudgets(ns.Name).List(context.TODO(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error while listing pod disruption budget")
|
t.Fatalf("Error while listing pod disruption budget")
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ func TestTerminalPodEviction(t *testing.T) {
|
|||||||
t.Fatalf("Expected the pdb generation to be of same value %v but got %v", newPdb.Status.ObservedGeneration, oldPdb.Status.ObservedGeneration)
|
t.Fatalf("Expected the pdb generation to be of same value %v but got %v", newPdb.Status.ObservedGeneration, oldPdb.Status.ObservedGeneration)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := clientSet.PolicyV1beta1().PodDisruptionBudgets(ns.Name).Delete(context.TODO(), pdb.Name, deleteOption); err != nil {
|
if err := clientSet.PolicyV1().PodDisruptionBudgets(ns.Name).Delete(context.TODO(), pdb.Name, deleteOption); err != nil {
|
||||||
t.Fatalf("Failed to delete pod disruption budget")
|
t.Fatalf("Failed to delete pod disruption budget")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ func waitToObservePods(t *testing.T, podInformer cache.SharedIndexInformer, podN
|
|||||||
|
|
||||||
func waitPDBStable(t *testing.T, clientSet clientset.Interface, podNum int32, ns, pdbName string) {
|
func waitPDBStable(t *testing.T, clientSet clientset.Interface, podNum int32, ns, pdbName string) {
|
||||||
if err := wait.PollImmediate(2*time.Second, 60*time.Second, func() (bool, error) {
|
if err := wait.PollImmediate(2*time.Second, 60*time.Second, func() (bool, error) {
|
||||||
pdb, err := clientSet.PolicyV1beta1().PodDisruptionBudgets(ns).Get(context.TODO(), pdbName, metav1.GetOptions{})
|
pdb, err := clientSet.PolicyV1().PodDisruptionBudgets(ns).Get(context.TODO(), pdbName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ func TestAPIServerMetrics(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make a request to a deprecated API to ensure there's at least one data point
|
// Make a request to a deprecated API to ensure there's at least one data point
|
||||||
if _, err := client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), metav1.ListOptions{}); err != nil {
|
if _, err := client.StorageV1beta1().CSIStorageCapacities("default").List(context.TODO(), metav1.ListOptions{}); err != nil {
|
||||||
t.Fatalf("unexpected error getting rbac roles: %v", err)
|
t.Fatalf("unexpected error getting rbac roles: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user