Skip to content

Commit 7c00e5b

Browse files
authored
Merge pull request #541 from weaveworks/retry-fixes
pkg/canary: fix status retry
2 parents 3b04f12 + f6baba2 commit 7c00e5b

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

pkg/canary/status.go

+5-15
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ func syncCanaryStatus(flaggerClient clientset.Interface, cd *flaggerv1.Canary, s
3838
cdCopy.Status.Conditions = conditions
3939
}
4040

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

68-
if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
69-
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
70-
}
66+
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
7167
firstTry = false
7268
return
7369
})
@@ -91,9 +87,7 @@ func setStatusWeight(flaggerClient clientset.Interface, cd *flaggerv1.Canary, va
9187
cdCopy.Status.CanaryWeight = val
9288
cdCopy.Status.LastTransitionTime = metav1.Now()
9389

94-
if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
95-
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
96-
}
90+
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
9791
firstTry = false
9892
return
9993
})
@@ -118,9 +112,7 @@ func setStatusIterations(flaggerClient clientset.Interface, cd *flaggerv1.Canary
118112
cdCopy.Status.Iterations = val
119113
cdCopy.Status.LastTransitionTime = metav1.Now()
120114

121-
if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
122-
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
123-
}
115+
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
124116
firstTry = false
125117
return
126118
})
@@ -160,9 +152,7 @@ func setStatusPhase(flaggerClient clientset.Interface, cd *flaggerv1.Canary, pha
160152
cdCopy.Status.Conditions = conditions
161153
}
162154

163-
if err = updateStatusWithUpgrade(flaggerClient, cdCopy); err != nil {
164-
return fmt.Errorf("updateStatusWithUpgrade failed: %w", err)
165-
}
155+
err = updateStatusWithUpgrade(flaggerClient, cdCopy)
166156
firstTry = false
167157
return
168158
})

0 commit comments

Comments
 (0)