@@ -322,7 +322,7 @@ func TestLiveUpdateMainImageHold(t *testing.T) {
322
322
}
323
323
f .st .KubernetesResources ["sancho" ] = resource
324
324
325
- sancho .State .MutableBuildStatus (sanchoImage .ID ()).PendingFileChanges [srcFile ] = time .Now ()
325
+ sancho .State .MutableBuildStatus (sanchoImage .ID ()).FileChanges [srcFile ] = time .Now ()
326
326
f .assertNoTargetNextToBuild ()
327
327
f .assertHold ("sancho" , store .HoldReasonReconciling )
328
328
@@ -338,7 +338,7 @@ func TestLiveUpdateMainImageHold(t *testing.T) {
338
338
f .assertNoTargetNextToBuild ()
339
339
340
340
// If the base image has a change, we have to rebuild.
341
- sancho .State .MutableBuildStatus (baseImage .ID ()).PendingFileChanges [srcFile ] = time .Now ()
341
+ sancho .State .MutableBuildStatus (baseImage .ID ()).FileChanges [srcFile ] = time .Now ()
342
342
f .assertNextTargetToBuild ("sancho" )
343
343
}
344
344
@@ -385,7 +385,7 @@ func TestLiveUpdateBaseImageHold(t *testing.T) {
385
385
}
386
386
f .st .KubernetesResources ["sancho" ] = resource
387
387
388
- sancho .State .MutableBuildStatus (baseImage .ID ()).PendingFileChanges [srcFile ] = time .Now ()
388
+ sancho .State .MutableBuildStatus (baseImage .ID ()).FileChanges [srcFile ] = time .Now ()
389
389
f .assertNoTargetNextToBuild ()
390
390
f .assertHold ("sancho" , store .HoldReasonReconciling )
391
391
@@ -401,7 +401,7 @@ func TestLiveUpdateBaseImageHold(t *testing.T) {
401
401
f .assertNoTargetNextToBuild ()
402
402
403
403
// If the deploy image has a change, we have to rebuild.
404
- sancho .State .MutableBuildStatus (sanchoImage .ID ()).PendingFileChanges [srcFile ] = time .Now ()
404
+ sancho .State .MutableBuildStatus (sanchoImage .ID ()).FileChanges [srcFile ] = time .Now ()
405
405
f .assertNextTargetToBuild ("sancho" )
406
406
}
407
407
@@ -472,15 +472,15 @@ func TestHoldForDeploy(t *testing.T) {
472
472
473
473
status := sancho .State .MutableBuildStatus (sanchoImage .ID ())
474
474
475
- status .PendingFileChanges [objFile ] = time .Now ()
475
+ status .FileChanges [objFile ] = time .Now (). Add ( - 2 * time . Second )
476
476
f .assertNextTargetToBuild ("sancho" )
477
- delete ( status .PendingFileChanges , objFile )
477
+ status .ConsumedChanges = time . Now (). Add ( - 2 * time . Second )
478
478
479
- status .PendingFileChanges [fallbackFile ] = time .Now ()
479
+ status .FileChanges [fallbackFile ] = time .Now (). Add ( - time . Second )
480
480
f .assertNextTargetToBuild ("sancho" )
481
- delete ( status .PendingFileChanges , fallbackFile )
481
+ status .ConsumedChanges = time . Now (). Add ( - time . Second )
482
482
483
- status .PendingFileChanges [srcFile ] = time .Now ()
483
+ status .FileChanges [srcFile ] = time .Now ()
484
484
f .assertNoTargetNextToBuild ()
485
485
f .assertHold ("sancho" , store .HoldReasonWaitingForDeploy )
486
486
@@ -544,11 +544,11 @@ func TestHoldForManualLiveUpdate(t *testing.T) {
544
544
// This shouldn't trigger a full-build, because it will be handled by the live-updater.
545
545
status := sancho .State .MutableBuildStatus (sanchoImage .ID ())
546
546
f .st .AppendToTriggerQueue (sancho .Manifest .Name , model .BuildReasonFlagTriggerCLI )
547
- status .PendingFileChanges [srcFile ] = time .Now ()
547
+ status .FileChanges [srcFile ] = time .Now ()
548
548
f .assertNoTargetNextToBuild ()
549
549
550
550
// This should trigger a full-rebuild, because we have a trigger without pending changes.
551
- delete ( status .PendingFileChanges , srcFile )
551
+ status .ConsumedChanges = time . Now ( )
552
552
f .assertNextTargetToBuild ("sancho" )
553
553
}
554
554
0 commit comments