@@ -512,7 +512,11 @@ func (w *SyncWorker) syncOnce(ctx context.Context, work *SyncWork, maxWorkers in
512
512
payloadUpdate .LoadedAt = time .Now ()
513
513
514
514
// need to make sure the payload is only set when the preconditions have been successful
515
- if ! info .Local && len (w .preconditions ) > 0 {
515
+ if len (w .preconditions ) == 0 {
516
+ klog .V (4 ).Info ("No preconditions configured." )
517
+ } else if info .Local {
518
+ klog .V (4 ).Info ("Skipping preconditions for a local operator image payload." )
519
+ } else {
516
520
reporter .Report (SyncWorkerStatus {
517
521
Generation : work .Generation ,
518
522
Step : "PreconditionChecks" ,
@@ -521,17 +525,21 @@ func (w *SyncWorker) syncOnce(ctx context.Context, work *SyncWork, maxWorkers in
521
525
Actual : update ,
522
526
Verified : info .Verified ,
523
527
})
524
- if err := precondition .Summarize (w .preconditions .RunAll (ctx , precondition.ReleaseContext {DesiredVersion : payloadUpdate .ReleaseVersion })); err != nil && ! update .Force {
525
- reporter .Report (SyncWorkerStatus {
526
- Generation : work .Generation ,
527
- Failure : err ,
528
- Step : "PreconditionChecks" ,
529
- Initial : work .State .Initializing (),
530
- Reconciling : work .State .Reconciling (),
531
- Actual : update ,
532
- Verified : info .Verified ,
533
- })
534
- return err
528
+ if err := precondition .Summarize (w .preconditions .RunAll (ctx , precondition.ReleaseContext {DesiredVersion : payloadUpdate .ReleaseVersion })); err != nil {
529
+ if update .Force {
530
+ klog .V (4 ).Infof ("Forcing past precondition failures: %s" , err )
531
+ } else {
532
+ reporter .Report (SyncWorkerStatus {
533
+ Generation : work .Generation ,
534
+ Failure : err ,
535
+ Step : "PreconditionChecks" ,
536
+ Initial : work .State .Initializing (),
537
+ Reconciling : work .State .Reconciling (),
538
+ Actual : update ,
539
+ Verified : info .Verified ,
540
+ })
541
+ return err
542
+ }
535
543
}
536
544
}
537
545
0 commit comments