mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Fix resize_nodes.go test.
This commit is contained in:
parent
c1af9dcb7f
commit
0773eb034c
@ -185,6 +185,7 @@ func rcByNamePort(name string, replicas int, image string, port int, labels map[
|
||||
func rcByNameContainer(name string, replicas int, image string, labels map[string]string, c api.Container) *api.ReplicationController {
|
||||
// Add "name": name to the labels, overwriting if it exists.
|
||||
labels["name"] = name
|
||||
gracePeriod := int64(0)
|
||||
return &api.ReplicationController{
|
||||
TypeMeta: unversioned.TypeMeta{
|
||||
Kind: "ReplicationController",
|
||||
@ -203,7 +204,8 @@ func rcByNameContainer(name string, replicas int, image string, labels map[strin
|
||||
Labels: labels,
|
||||
},
|
||||
Spec: api.PodSpec{
|
||||
Containers: []api.Container{c},
|
||||
Containers: []api.Container{c},
|
||||
TerminationGracePeriodSeconds: &gracePeriod,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -768,7 +768,10 @@ func waitForPodToDisappear(c *client.Client, ns, podName string, label labels.Se
|
||||
// In case of failure or too long waiting time, an error is returned.
|
||||
func waitForRCPodToDisappear(c *client.Client, ns, rcName, podName string) error {
|
||||
label := labels.SelectorFromSet(labels.Set(map[string]string{"name": rcName}))
|
||||
return waitForPodToDisappear(c, ns, podName, label, 20*time.Second, 5*time.Minute)
|
||||
// NodeController evicts pod after 5 minutes, so we need timeout greater than that.
|
||||
// Additionally, there can be non-zero grace period, so we are setting 10 minutes
|
||||
// to be on the safe size.
|
||||
return waitForPodToDisappear(c, ns, podName, label, 20*time.Second, 10*time.Minute)
|
||||
}
|
||||
|
||||
// waitForService waits until the service appears (exist == true), or disappears (exist == false)
|
||||
|
Loading…
Reference in New Issue
Block a user