@@ -204,23 +204,22 @@ protected void after(ExtensionContext context) {
204204 if (namespace != null ) {
205205 if (preserveNamespaceOnError && context .getExecutionException ().isPresent ()) {
206206 LOGGER .info ("Preserving namespace {}" , namespace );
207- } else if (skipNamespaceDeletion ) {
208- LOGGER .info ("Skipping namespace deletion for {}" , namespace );
209- deleteOperator ();
210207 } else {
211208 infrastructureKubernetesClient .resourceList (infrastructure ).delete ();
212209 deleteOperator ();
213- LOGGER .info ("Deleting namespace {} and stopping operator" , namespace );
214- infrastructureKubernetesClient .namespaces ().withName (namespace ).delete ();
215- if (waitForNamespaceDeletion ) {
216- LOGGER .info ("Waiting for namespace {} to be deleted" , namespace );
217- Awaitility .await ("namespace deleted" )
218- .pollInterval (50 , TimeUnit .MILLISECONDS )
219- .atMost (namespaceDeleteTimeout , TimeUnit .SECONDS )
220- .until (
221- () ->
222- infrastructureKubernetesClient .namespaces ().withName (namespace ).get ()
223- == null );
210+ if (skipNamespaceDeletion ) {
211+ LOGGER .info ("Deleting namespace {} and stopping operator" , namespace );
212+ infrastructureKubernetesClient .namespaces ().withName (namespace ).delete ();
213+ if (waitForNamespaceDeletion ) {
214+ LOGGER .info ("Waiting for namespace {} to be deleted" , namespace );
215+ Awaitility .await ("namespace deleted" )
216+ .pollInterval (50 , TimeUnit .MILLISECONDS )
217+ .atMost (namespaceDeleteTimeout , TimeUnit .SECONDS )
218+ .until (
219+ () ->
220+ infrastructureKubernetesClient .namespaces ().withName (namespace ).get ()
221+ == null );
222+ }
224223 }
225224 }
226225 }
0 commit comments