fix(tiller): Fixes bug with `--wait` and updated deployments

The current methodology generated its own RS slice instead of using
a helper method that uses a `clientset`. This caused some issues where
`FindNewReplicaSet` always returned `nil`. This switches the method and
removes some unneeded API calls and code.

Closes #2426
pull/2430/head
Taylor Thomas 8 years ago
parent a9f0be9bf3
commit d310612526

@ -52,7 +52,6 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
pods := []v1.Pod{}
services := []v1.Service{}
pvc := []v1.PersistentVolumeClaim{}
replicaSets := []*extensions.ReplicaSet{}
deployments := []deployment{}
for _, v := range created {
obj, err := c.AsVersionedObject(v.Object)
@ -73,25 +72,12 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
}
pods = append(pods, *pod)
case (*extensions.Deployment):
// Get the RS children first
rs, err := client.Extensions().ReplicaSets(value.Namespace).List(metav1.ListOptions{
FieldSelector: fields.Everything().String(),
LabelSelector: labels.Set(value.Spec.Selector.MatchLabels).AsSelector().String(),
})
if err != nil {
return false, err
}
for _, i := range rs.Items {
replicaSets = append(replicaSets, &i)
}
currentDeployment, err := client.Extensions().Deployments(value.Namespace).Get(value.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
// Find RS associated with deployment
newReplicaSet, err := deploymentutil.FindNewReplicaSet(currentDeployment, replicaSets)
newReplicaSet, err := deploymentutil.GetNewReplicaSet(currentDeployment, client)
if err != nil || newReplicaSet == nil {
return false, err
}

Loading…
Cancel
Save