@@ -297,7 +297,8 @@ public NextAction apply(Packet packet) {
297
297
madeChange = true ;
298
298
}
299
299
300
- // This will control if we need to re-check states soon or if we can slow down checks
300
+ // This will control if we need to re-check states soon or if we can slow down
301
+ // checks
301
302
packet .put (ProcessingConstants .STATUS_UNCHANGED , Boolean .valueOf (!madeChange ));
302
303
303
304
if (madeChange ) {
@@ -658,7 +659,12 @@ public NextAction onFailure(
658
659
if (statusCode == CallBuilder .NOT_FOUND ) {
659
660
return doNext (packet ); // Just ignore update
660
661
}
661
- return super .onFailure (conflictStep , packet , e , statusCode , responseHeaders );
662
+ return super .onFailure (
663
+ getRereadDomainConflictStep (factory , info , meta , conflictStep ),
664
+ packet ,
665
+ e ,
666
+ statusCode ,
667
+ responseHeaders );
662
668
}
663
669
664
670
@ Override
@@ -675,6 +681,38 @@ public NextAction onSuccess(
675
681
return na ;
676
682
}
677
683
684
+ private static Step getRereadDomainConflictStep (
685
+ CallBuilderFactory factory , DomainPresenceInfo info , V1ObjectMeta meta , Step next ) {
686
+ return factory
687
+ .create ()
688
+ .readDomainAsync (
689
+ meta .getName (),
690
+ meta .getNamespace (),
691
+ new ResponseStep <Domain >(next ) {
692
+ @ Override
693
+ public NextAction onFailure (
694
+ Packet packet ,
695
+ ApiException e ,
696
+ int statusCode ,
697
+ Map <String , List <String >> responseHeaders ) {
698
+ if (statusCode == CallBuilder .NOT_FOUND ) {
699
+ return doNext (packet );
700
+ }
701
+ return super .onFailure (packet , e , statusCode , responseHeaders );
702
+ }
703
+
704
+ @ Override
705
+ public NextAction onSuccess (
706
+ Packet packet ,
707
+ Domain result ,
708
+ int statusCode ,
709
+ Map <String , List <String >> responseHeaders ) {
710
+ info .setDomain (result );
711
+ return doNext (packet );
712
+ }
713
+ });
714
+ }
715
+
678
716
/**
679
717
* Asynchronous step to set Domain condition to Failed
680
718
*
0 commit comments