Skip to content

Commit 778f657

Browse files
committed
Address Review Comments
1 parent acb9328 commit 778f657

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

pkg/errors/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ var (
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

pkg/requeue/requeue.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff 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.
3126
func Needed(err error) *RequeueNeeded {

pkg/runtime/reconciler.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ package runtime
1515

1616
import (
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(

0 commit comments

Comments
 (0)