diff --git a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/KubernetesResourceCleaner.scala b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/KubernetesResourceCleaner.scala index 6360bc0e48948..6329bb1359516 100644 --- a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/KubernetesResourceCleaner.scala +++ b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/KubernetesResourceCleaner.scala @@ -39,13 +39,15 @@ private[spark] class KubernetesResourceCleaner extends Logging { def deleteAllRegisteredResourcesFromKubernetes(kubernetesClient: KubernetesClient): Unit = { synchronized { - logInfo(s"Deleting ${resources.size} registered Kubernetes resources:") + val resourceCount = resources.size + logInfo(s"Deleting ${resourceCount} registered Kubernetes resources...") resources.values.foreach { resource => Utils.tryLogNonFatalError { kubernetesClient.resource(resource).delete() } } resources.clear() + logInfo(s"Deleted ${resourceCount} registered Kubernetes resources.") } } }