attilapiros commented on code in PR #37990:
URL: https://github.com/apache/spark/pull/37990#discussion_r979436243
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsLifecycleManager.scala:
##########
@@ -168,23 +171,19 @@ private[spark] class ExecutorPodsLifecycleManager(
// of getting rid of the pod is what matters.
kubernetesClient
.pods()
+ .inNamespace(namespace)
.withName(updatedPod.getMetadata.getName)
.delete()
} else if (!inactivatedPods.contains(execId) &&
!isPodInactive(updatedPod)) {
// If the config is set to keep the executor around, mark the pod as
"inactive" so it
// can be ignored in future updates from the API server.
logDebug(s"Marking executor ${updatedPod.getMetadata.getName} as
inactive since " +
"deletion is disabled.")
- val inactivatedPod = new PodBuilder(updatedPod)
- .editMetadata()
- .addToLabels(Map(SPARK_EXECUTOR_INACTIVE_LABEL -> "true").asJava)
- .endMetadata()
- .build()
-
kubernetesClient
.pods()
+ .inNamespace(namespace)
.withName(updatedPod.getMetadata.getName)
- .patch(inactivatedPod)
+ .edit(executorInactivationFn)
Review Comment:
As I see the `edit` is preferred over the `patch`, see
[kubernetes-client-dsl-usage](https://github.com/fabric8io/kubernetes-client/blob/master/doc/CHEATSHEET.md#kubernetes-client-dsl-usage
)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]