@@ -242,6 +242,7 @@ private ResponseStep<Domain> createResponseStep(DomainStatusUpdaterContext conte
242242 return new StatusReplaceResponseStep (this ,
243243 /* MARKER-2.6.0-ONLY */
244244 newStatus ,
245+ useDomainStatusEndpoint ,
245246 /* END-2.6.0-ONLY */
246247 context , next );
247248 }
@@ -252,18 +253,21 @@ static class StatusReplaceResponseStep extends DefaultResponseStep<Domain> {
252253 private final DomainStatusUpdaterContext context ;
253254 /* MARKER-2.6.0-ONLY */
254255 private final DomainStatus newStatus ;
256+ private final boolean useDomainStatusEndpoint ;
255257 /* END-2.6.0-ONLY */
256258
257259 public StatusReplaceResponseStep (DomainStatusUpdaterStep updaterStep ,
258260 /* MARKER-2.6.0-ONLY */
259261 DomainStatus newStatus ,
262+ boolean useDomainStatusEndpoint ,
260263 /* END-2.6.0-ONLY */
261264 DomainStatusUpdaterContext context , Step nextStep ) {
262265 super (nextStep );
263266 this .updaterStep = updaterStep ;
264267 this .context = context ;
265268 /* MARKER-2.6.0-ONLY */
266269 this .newStatus = newStatus ;
270+ this .useDomainStatusEndpoint = useDomainStatusEndpoint ;
267271 /* END-2.6.0-ONLY */
268272 }
269273
@@ -273,15 +277,9 @@ public NextAction onSuccess(Packet packet, CallResponse<Domain> callResponse) {
273277 // If the 3.0.0 operator updated the CRD to use status endpoint while this operator is running
274278 // then these domain replace calls will succeed, but the proposed domain status will have been
275279 // ignored. Check if the status on the returned domain is expected
276- if (callResponse .getResult () == null || !newStatus .equals (callResponse .getResult ().getStatus ())) {
280+ if (!useDomainStatusEndpoint
281+ && (callResponse .getResult () == null || !newStatus .equals (callResponse .getResult ().getStatus ()))) {
277282 LOGGER .info (MessageKeys .DOMAIN_STATUS_IGNORED );
278-
279- // TEST
280- if (callResponse .getResult () != null ) {
281- System .out .println ("response status: " + callResponse .getResult ().getStatus ());
282- }
283- System .out .println ("expected newStatus: " + newStatus );
284-
285283 return doNext (CrdHelper .createDomainCrdStep (packet .getSpi (KubernetesVersion .class ),
286284 createRetry (context , getNext ())), packet );
287285 }
0 commit comments