File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 4949 // after some wait time
5050 TemporaryOutOfSync = fmt .Errorf (
5151 "temporary out of sync, reconcile after some time" )
52- // TemporaryOutOfSync is to indicate the error isn't really an error
52+ // RequeueOnSuccess is to indicate the error isn't really an error
5353 // but more of a marker that the status check will be performed
54- // after some wait time
54+ // after some wait time after the specified duration
5555 RequeueOnSuccess = fmt .Errorf (
5656 "resource creation successful but reconcile after some time" )
5757 // Terminal is returned with resource is in Terminal Condition
Original file line number Diff line number Diff line change @@ -21,11 +21,6 @@ const (
2121 DefaultRequeueAfterDuration time.Duration = 30 * time .Second
2222)
2323
24- // GetDurationInSeconds converts an integer into a time duration in seconds
25- func GetDurationInSeconds (duration int ) time.Duration {
26- return time .Duration (duration ) * time .Second
27- }
28-
2924// Needed returns a new RequeueNeeded to instruct the ACK runtime to requeue
3025// the processing item without been logged as error.
3126func Needed (err error ) * RequeueNeeded {
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ package runtime
1515
1616import (
1717 "context"
18-
18+ "time"
19+
1920 "github.com/go-logr/logr"
2021 "github.com/pkg/errors"
2122 corev1 "k8s.io/api/core/v1"
@@ -273,10 +274,10 @@ func (r *resourceReconciler) Sync(
273274 for _ , condition := range latest .Conditions () {
274275 if condition .Type == ackv1alpha1 .ConditionTypeResourceSynced {
275276 if condition .Status == corev1 .ConditionTrue {
276- duration , status := r .rmf .GetRequeueOnSuccessSeconds ()
277- if status {
277+ duration , isRequeueOnSuccess := r .rmf .GetRequeueOnSuccessSeconds ()
278+ if isRequeueOnSuccess {
278279 return requeue .NeededAfter (
279- ackerr .RequeueOnSuccess , requeue . GetDurationInSeconds (duration ))
280+ ackerr .RequeueOnSuccess , ( time . Duration (duration ) * time . Second ))
280281 }
281282 } else {
282283 return requeue .NeededAfter (
You can’t perform that action at this time.
0 commit comments