Add a custom timeout flag for stop/delete. Also try to be smarter about setting the timeout.

This commit is contained in:
Brendan Burns
2015-05-29 16:16:30 -07:00
parent 3cb30e1e21
commit ab0c9b8e1e
12 changed files with 44 additions and 20 deletions

View File

@@ -103,7 +103,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
if err != nil {
Logf("Failed to cleanup replication controller %v: %v.", controller.Name, err)
}
if _, err = rcReaper.Stop(ns, controller.Name, nil); err != nil {
if _, err = rcReaper.Stop(ns, controller.Name, 0, nil); err != nil {
Logf("Failed to stop replication controller %v: %v.", controller.Name, err)
}
}()

View File

@@ -898,7 +898,7 @@ func DeleteRC(c *client.Client, ns, name string) error {
return err
}
startTime := time.Now()
_, err = reaper.Stop(ns, name, api.NewDeleteOptions(0))
_, err = reaper.Stop(ns, name, 0, api.NewDeleteOptions(0))
deleteRCTime := time.Now().Sub(startTime)
Logf("Deleting RC took: %v", deleteRCTime)
return err

View File

@@ -184,7 +184,7 @@ func StopRC(rc *api.ReplicationController, restClient *client.Client) error {
if err != nil || reaper == nil {
return err
}
_, err = reaper.Stop(rc.Namespace, rc.Name, nil)
_, err = reaper.Stop(rc.Namespace, rc.Name, 0, nil)
if err != nil {
return err
}