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
This commit is contained in:
Kubernetes Submit Queue 2017-09-21 09:20:21 -07:00 committed by GitHub
commit 995d5ca54a

View File

@ -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)
}
}