From 51f887a7763f06c8a16081fb4036dc6c43bab58b Mon Sep 17 00:00:00 2001 From: Nick Hirakawa Date: Thu, 16 Jun 2022 10:45:02 -0400 Subject: [PATCH 1/2] Add debug logging for deletes in OperationSupport --- .../fabric8/kubernetes/client/dsl/base/OperationSupport.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java index 9d34fedb95d..0da343199c2 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java @@ -50,6 +50,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import static io.fabric8.kubernetes.client.internal.PatchUtils.patchMapper; @@ -281,6 +282,8 @@ protected void handleDelete(URL requestUrl, long gracePeriodSeconds, DeletionPro deleteOptions.setDryRun(Collections.singletonList("All")); } + LOG.debug("Executing delete for {} with {} grace period seconds", requestUrl, gracePeriodSeconds); + HttpRequest.Builder requestBuilder = httpClient.newHttpRequestBuilder().delete(JSON, JSON_MAPPER.writeValueAsString(deleteOptions)).url(requestUrl); handleResponse(requestBuilder, null, Collections.emptyMap()); } From 5bff02977a4fce4ca37490233686405ac8648e48 Mon Sep 17 00:00:00 2001 From: Nick Hirakawa Date: Thu, 16 Jun 2022 13:08:28 -0400 Subject: [PATCH 2/2] Log DeleteOptions body --- .../fabric8/kubernetes/client/dsl/base/OperationSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java index 0da343199c2..fcb5a68602c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java @@ -282,9 +282,10 @@ protected void handleDelete(URL requestUrl, long gracePeriodSeconds, DeletionPro deleteOptions.setDryRun(Collections.singletonList("All")); } - LOG.debug("Executing delete for {} with {} grace period seconds", requestUrl, gracePeriodSeconds); + String deleteOptionsBody = JSON_MAPPER.writeValueAsString(deleteOptions); + LOG.debug("Executing delete for {} with body {}", requestUrl, deleteOptionsBody); - HttpRequest.Builder requestBuilder = httpClient.newHttpRequestBuilder().delete(JSON, JSON_MAPPER.writeValueAsString(deleteOptions)).url(requestUrl); + HttpRequest.Builder requestBuilder = httpClient.newHttpRequestBuilder().delete(JSON, deleteOptionsBody).url(requestUrl); handleResponse(requestBuilder, null, Collections.emptyMap()); }