tests/bootkube: handle errors better in delete test
@@ -59,8 +59,15 @@ func deleteAPIServer(tc cluster.TestCluster) error {
}
apipods := strings.Split(strings.TrimSpace(out), " ")
+ if len(apipods) < 1 {
+ return fmt.Errorf("Failed detect any apiserver pods for deletion")
+ }
+
for _, pod := range apipods {
- c.Kubectl("delete pod " + pod + " --namespace=kube-system")
+ _, err := c.Kubectl("delete pod " + pod + " --namespace=kube-system")
+ if err != nil {
+ return fmt.Errorf("Unable to delete apiserver pod: %s", err)
+ }
}
// wait until kubectl errors out to know that apiserver terminated
@@ -71,7 +78,7 @@ func deleteAPIServer(tc cluster.TestCluster) error {
}
return nil
}
- if err := util.Retry(25, 2*time.Second, f); err != nil {
+ if err := util.Retry(40, 1*time.Second, f); err != nil {
return fmt.Errorf("apiserver never terminated: %s", err)
}
