@@ -128,7 +128,7 @@ func TestSummarizeAndPatch(t *testing.T) {
128
128
name : "Success, removes reconciling for successful result" ,
129
129
generation : 2 ,
130
130
beforeFunc : func (obj conditions.Setter ) {
131
- conditions .MarkReconciling (obj , "NewRevision" , "new index version" )
131
+ conditions .MarkReconciling (obj , meta . ProgressingReason , "new index version" )
132
132
conditions .MarkTrue (obj , meta .ReadyCondition , meta .SucceededReason , "stored artifact" )
133
133
},
134
134
conditions : []Conditions {testReadyConditions },
@@ -167,15 +167,15 @@ func TestSummarizeAndPatch(t *testing.T) {
167
167
generation : 7 ,
168
168
beforeFunc : func (obj conditions.Setter ) {
169
169
conditions .MarkTrue (obj , sourcev1 .ArtifactOutdatedCondition , "NewRevision" , "new index revision" )
170
- conditions .MarkReconciling (obj , "NewRevision" , "new index revision" )
170
+ conditions .MarkReconciling (obj , meta . ProgressingReason , "new index revision" )
171
171
},
172
172
conditions : []Conditions {testReadyConditions },
173
173
reconcileErr : fmt .Errorf ("failed to create dir" ),
174
174
wantErr : true ,
175
175
assertConditions : []metav1.Condition {
176
176
* conditions .FalseCondition (meta .ReadyCondition , "NewRevision" , "new index revision" ),
177
177
* conditions .TrueCondition (sourcev1 .ArtifactOutdatedCondition , "NewRevision" , "new index revision" ),
178
- * conditions .TrueCondition (meta .ReconcilingCondition , "NewRevision" , "new index revision" ),
178
+ * conditions .TrueCondition (meta .ReconcilingCondition , meta . ProgressingWithRetryReason , "new index revision" ),
179
179
},
180
180
afterFunc : func (t * WithT , obj client.Object ) {
181
181
t .Expect (obj ).ToNot (HaveStatusObservedGeneration (7 ))
@@ -264,7 +264,7 @@ func TestSummarizeAndPatch(t *testing.T) {
264
264
name : "Fail, reconciling with bipolar condition False, Ready gets bipolar failure value" ,
265
265
generation : 2 ,
266
266
beforeFunc : func (obj conditions.Setter ) {
267
- conditions .MarkReconciling (obj , "NewRevision" , "new index revision" )
267
+ conditions .MarkReconciling (obj , meta . ProgressingReason , "new index revision" )
268
268
conditions .MarkFalse (obj , sourcev1 .SourceVerifiedCondition , "VerifyFailed" , "verify failed" )
269
269
},
270
270
result : reconcile .ResultEmpty ,
@@ -275,14 +275,14 @@ func TestSummarizeAndPatch(t *testing.T) {
275
275
assertConditions : []metav1.Condition {
276
276
* conditions .FalseCondition (meta .ReadyCondition , "VerifyFailed" , "verify failed" ),
277
277
* conditions .FalseCondition (sourcev1 .SourceVerifiedCondition , "VerifyFailed" , "verify failed" ),
278
- * conditions .TrueCondition (meta .ReconcilingCondition , "NewRevision" , "new index revision" ),
278
+ * conditions .TrueCondition (meta .ReconcilingCondition , meta . ProgressingWithRetryReason , "new index revision" ),
279
279
},
280
280
},
281
281
{
282
282
name : "Fail, bipolar condition True, negative polarity True, Ready gets negative polarity value" ,
283
283
generation : 2 ,
284
284
beforeFunc : func (obj conditions.Setter ) {
285
- conditions .MarkReconciling (obj , "NewGeneration" , "new obj gen" )
285
+ conditions .MarkReconciling (obj , meta . ProgressingReason , "new obj gen" )
286
286
conditions .MarkTrue (obj , sourcev1 .ArtifactOutdatedCondition , "NewRevision" , "new digest" )
287
287
conditions .MarkTrue (obj , sourcev1 .SourceVerifiedCondition , "Success" , "verified" )
288
288
},
@@ -294,7 +294,7 @@ func TestSummarizeAndPatch(t *testing.T) {
294
294
assertConditions : []metav1.Condition {
295
295
* conditions .FalseCondition (meta .ReadyCondition , "NewRevision" , "new digest" ),
296
296
* conditions .TrueCondition (sourcev1 .ArtifactOutdatedCondition , "NewRevision" , "new digest" ),
297
- * conditions .TrueCondition (meta .ReconcilingCondition , "NewGeneration" , "new obj gen" ),
297
+ * conditions .TrueCondition (meta .ReconcilingCondition , meta . ProgressingWithRetryReason , "new obj gen" ),
298
298
* conditions .TrueCondition (sourcev1 .SourceVerifiedCondition , "Success" , "verified" ),
299
299
},
300
300
},
@@ -345,10 +345,9 @@ func TestSummarizeAndPatch(t *testing.T) {
345
345
346
346
ctx := context .TODO ()
347
347
g .Expect (client .Create (ctx , obj )).To (Succeed ())
348
- patchHelper , err := patch .NewHelper (obj , client )
349
- g .Expect (err ).ToNot (HaveOccurred ())
348
+ serialPatcher := patch .NewSerialPatcher (obj , client )
350
349
351
- summaryHelper := NewHelper (record .NewFakeRecorder (32 ), patchHelper )
350
+ summaryHelper := NewHelper (record .NewFakeRecorder (32 ), serialPatcher )
352
351
summaryOpts := []Option {
353
352
WithReconcileResult (tt .result ),
354
353
WithReconcileError (tt .reconcileErr ),
@@ -471,15 +470,14 @@ func TestSummarizeAndPatch_Intermediate(t *testing.T) {
471
470
472
471
ctx := context .TODO ()
473
472
g .Expect (kclient .Create (ctx , obj )).To (Succeed ())
474
- patchHelper , err := patch .NewHelper (obj , kclient )
475
- g .Expect (err ).ToNot (HaveOccurred ())
473
+ serialPatcher := patch .NewSerialPatcher (obj , kclient )
476
474
477
- summaryHelper := NewHelper (record .NewFakeRecorder (32 ), patchHelper )
475
+ summaryHelper := NewHelper (record .NewFakeRecorder (32 ), serialPatcher )
478
476
summaryOpts := []Option {
479
477
WithConditions (tt .conditions ... ),
480
478
WithResultBuilder (reconcile.AlwaysRequeueResultBuilder {RequeueAfter : interval }),
481
479
}
482
- _ , err = summaryHelper .SummarizeAndPatch (ctx , obj , summaryOpts ... )
480
+ _ , err : = summaryHelper .SummarizeAndPatch (ctx , obj , summaryOpts ... )
483
481
g .Expect (err ).ToNot (HaveOccurred ())
484
482
485
483
g .Expect (obj .Status .Conditions ).To (conditions .MatchConditions (tt .assertConditions ))
0 commit comments