@@ -217,7 +217,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, obj *sourcev1.G
217
217
// Reconcile the source from upstream
218
218
var artifact sourcev1.Artifact
219
219
if result , err := r .reconcileSource (ctx , obj , & artifact , tmpDir ); err != nil || result .IsZero () {
220
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, err
220
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, err
221
221
}
222
222
223
223
// Reconcile includes from the storage
@@ -231,7 +231,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, obj *sourcev1.G
231
231
return result , err
232
232
}
233
233
234
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
234
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
235
235
}
236
236
237
237
// reconcileStorage ensures the current state of the storage matches the desired and previously observed state.
@@ -264,7 +264,7 @@ func (r *GitRepositoryReconciler) reconcileStorage(ctx context.Context, obj *sou
264
264
r .Storage .SetArtifactURL (obj .GetArtifact ())
265
265
obj .Status .URL = r .Storage .SetHostname (obj .Status .URL )
266
266
267
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
267
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
268
268
}
269
269
270
270
// reconcileSource ensures the upstream Git repository can be reached and checked out using the declared configuration,
@@ -364,7 +364,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
364
364
if ! obj .GetArtifact ().HasRevision (revision ) {
365
365
conditions .MarkTrue (obj , sourcev1 .ArtifactOutdatedCondition , "NewRevision" , "New upstream revision '%s'" , revision )
366
366
}
367
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
367
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
368
368
}
369
369
370
370
// reconcileArtifact archives a new artifact to the storage, if the current observation on the object does not match the
@@ -394,7 +394,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *so
394
394
// The artifact is up-to-date
395
395
if obj .GetArtifact ().HasRevision (artifact .Revision ) && ! includes .Diff (obj .Status .IncludedArtifacts ) {
396
396
ctrl .LoggerFrom (ctx ).Info ("Artifact is up-to-date" )
397
- return ctrl.Result {RequeueAfter : obj .GetInterval (). Duration }, nil
397
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
398
398
}
399
399
400
400
// Ensure target path exists and is a directory
@@ -453,7 +453,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *so
453
453
if url != "" {
454
454
obj .Status .URL = url
455
455
}
456
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
456
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
457
457
}
458
458
459
459
// reconcileInclude reconciles the declared includes from the object by copying their artifact (sub)contents to the
@@ -508,7 +508,7 @@ func (r *GitRepositoryReconciler) reconcileInclude(ctx context.Context, obj *sou
508
508
if artifacts .Diff (obj .Status .IncludedArtifacts ) {
509
509
conditions .MarkTrue (obj , sourcev1 .ArtifactOutdatedCondition , "IncludeChange" , "Included artifacts differ from last observed includes" )
510
510
}
511
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
511
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
512
512
}
513
513
514
514
// reconcileDelete handles the delete of an object. It first garbage collects all artifacts for the object from the
@@ -532,7 +532,7 @@ func (r *GitRepositoryReconciler) verifyCommitSignature(ctx context.Context, obj
532
532
// Check if there is a commit verification is configured and remove any old observations if there is none
533
533
if obj .Spec .Verification == nil || obj .Spec .Verification .Mode == "" {
534
534
conditions .Delete (obj , sourcev1 .SourceVerifiedCondition )
535
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
535
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
536
536
}
537
537
538
538
// Get secret with GPG data
@@ -557,7 +557,7 @@ func (r *GitRepositoryReconciler) verifyCommitSignature(ctx context.Context, obj
557
557
558
558
conditions .MarkTrue (obj , sourcev1 .SourceVerifiedCondition , meta .SucceededReason , "Verified signature of commit '%s'" , commit .Hash ())
559
559
r .Eventf (ctx , obj , events .EventSeverityInfo , "VerifiedCommit" , "Verified signature of commit '%s'" , commit .Hash ())
560
- return ctrl.Result {RequeueAfter : obj .Spec . Interval . Duration }, nil
560
+ return ctrl.Result {RequeueAfter : obj .GetRequeueAfter () }, nil
561
561
}
562
562
563
563
// garbageCollect performs a garbage collection for the given v1beta1.GitRepository. It removes all but the current
0 commit comments