Commit 995d5ca5 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #52843 from aleksandra-malinowska/autoscaling-test-fix-4

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Improve cluster autoscaling tests logging and error checking during cleanup This adds extra logs and error checks to autoscaling tests during PodDisruptionBudgets cleanup. It should help with identifying flake causes. Follow up to #52796
parents 158f6b78 5a0f1c87
......@@ -1410,8 +1410,18 @@ func addKubeSystemPdbs(f *framework.Framework) (func(), error) {
newPdbs := make([]string, 0)
cleanup := func() {
var finalErr error
for _, newPdbName := range newPdbs {
f.ClientSet.Policy().PodDisruptionBudgets("kube-system").Delete(newPdbName, &metav1.DeleteOptions{})
By(fmt.Sprintf("Delete PodDisruptionBudget %v", newPdbName))
err := f.ClientSet.Policy().PodDisruptionBudgets("kube-system").Delete(newPdbName, &metav1.DeleteOptions{})
if err != nil {
// log error, but attempt to remove other pdbs
glog.Errorf("Failed to delete PodDisruptionBudget %v, err: %v", newPdbName, err)
finalErr = err
}
}
if finalErr != nil {
framework.Failf("Error during PodDisruptionBudget cleanup: %v", finalErr)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment