mirror of https://github.com/k3s-io/k3s
Increase timeout for deleting RC in e2e tests.
parent
cf7b0bdc2a
commit
ff8c772fe0
|
@ -60,6 +60,10 @@ func ReaperFor(kind string, c client.Interface) (Reaper, error) {
|
||||||
return nil, &NoSuchReaperError{kind}
|
return nil, &NoSuchReaperError{kind}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ReaperForReplicationController(c client.Interface, timeout time.Duration) (Reaper, error) {
|
||||||
|
return &ReplicationControllerReaper{c, Interval, timeout}, nil
|
||||||
|
}
|
||||||
|
|
||||||
type ReplicationControllerReaper struct {
|
type ReplicationControllerReaper struct {
|
||||||
client.Interface
|
client.Interface
|
||||||
pollInterval, timeout time.Duration
|
pollInterval, timeout time.Duration
|
||||||
|
|
|
@ -827,11 +827,14 @@ func waitForRCPodsRunning(c *client.Client, ns, rcName string) error {
|
||||||
// Delete a Replication Controller and all pods it spawned
|
// Delete a Replication Controller and all pods it spawned
|
||||||
func DeleteRC(c *client.Client, ns, name string) error {
|
func DeleteRC(c *client.Client, ns, name string) error {
|
||||||
By(fmt.Sprintf("Deleting replication controller %s in namespace %s", name, ns))
|
By(fmt.Sprintf("Deleting replication controller %s in namespace %s", name, ns))
|
||||||
reaper, err := kubectl.ReaperFor("ReplicationController", c)
|
reaper, err := kubectl.ReaperForReplicationController(c, 10*time.Minute)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
startTime := time.Now()
|
||||||
_, err = reaper.Stop(ns, name, api.NewDeleteOptions(0))
|
_, err = reaper.Stop(ns, name, api.NewDeleteOptions(0))
|
||||||
|
deleteRCTime := time.Now().Sub(startTime)
|
||||||
|
Logf("Deleting RC took: %v", deleteRCTime)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue