Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/canary: fix status retry #541

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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