From b0e7b8c9d98cbed46f3e4ae1e6060a979ab2d940 Mon Sep 17 00:00:00 2001 From: Per Hermansson Date: Mon, 20 May 2019 21:43:09 +0200 Subject: [PATCH] Skip waiting for paused deployments Signed-off-by: Per Hermansson --- pkg/kube/wait.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/kube/wait.go b/pkg/kube/wait.go index 105d79b93..ad779bcc8 100644 --- a/pkg/kube/wait.go +++ b/pkg/kube/wait.go @@ -71,6 +71,10 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error { if err != nil { return false, err } + // If paused deployment will never be ready + if currentDeployment.Spec.Paused { + continue + } // Find RS associated with deployment newReplicaSet, err := deploymentutil.GetNewReplicaSet(currentDeployment, kcs.AppsV1()) if err != nil || newReplicaSet == nil { @@ -86,6 +90,10 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error { if err != nil { return false, err } + // If paused deployment will never be ready + if currentDeployment.Spec.Paused { + continue + } // Find RS associated with deployment newReplicaSet, err := deploymentutil.GetNewReplicaSet(currentDeployment, kcs.AppsV1()) if err != nil || newReplicaSet == nil { @@ -101,6 +109,10 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error { if err != nil { return false, err } + // If paused deployment will never be ready + if currentDeployment.Spec.Paused { + continue + } // Find RS associated with deployment newReplicaSet, err := deploymentutil.GetNewReplicaSet(currentDeployment, kcs.AppsV1()) if err != nil || newReplicaSet == nil { @@ -116,6 +128,10 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error { if err != nil { return false, err } + // If paused deployment will never be ready + if currentDeployment.Spec.Paused { + continue + } // Find RS associated with deployment newReplicaSet, err := deploymentutil.GetNewReplicaSet(currentDeployment, kcs.AppsV1()) if err != nil || newReplicaSet == nil {