Skip to content

Commit

Permalink
Merge pull request #541 from weaveworks/retry-fixes
Browse files Browse the repository at this point in the history
pkg/canary: fix status retry
  • Loading branch information
stefanprodan authored Apr 1, 2020
2 parents 3b04f12 + f6baba2 commit 7c00e5b
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions pkg/canary/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ func syncCanaryStatus(flaggerClient clientset.Interface, cd *flaggerv1.Canary, s
cdCopy.Status.Conditions = conditions
}

if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
}
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
firstTry = false
return
})
Expand All @@ -65,9 +63,7 @@ func setStatusFailedChecks(flaggerClient clientset.Interface, cd *flaggerv1.Cana
cdCopy.Status.FailedChecks = val
cdCopy.Status.LastTransitionTime = metav1.Now()

if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
}
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
firstTry = false
return
})
Expand All @@ -91,9 +87,7 @@ func setStatusWeight(flaggerClient clientset.Interface, cd *flaggerv1.Canary, va
cdCopy.Status.CanaryWeight = val
cdCopy.Status.LastTransitionTime = metav1.Now()

if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
}
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
firstTry = false
return
})
Expand All @@ -118,9 +112,7 @@ func setStatusIterations(flaggerClient clientset.Interface, cd *flaggerv1.Canary
cdCopy.Status.Iterations = val
cdCopy.Status.LastTransitionTime = metav1.Now()

if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
}
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
firstTry = false
return
})
Expand Down Expand Up @@ -160,9 +152,7 @@ func setStatusPhase(flaggerClient clientset.Interface, cd *flaggerv1.Canary, pha
cdCopy.Status.Conditions = conditions
}

if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
}
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
firstTry = false
return
})
Expand Down

0 comments on commit 7c00e5b

Please sign in to comment.