stijndehaes commented on a change in pull request #29934:
URL: https://github.com/apache/spark/pull/29934#discussion_r499787259
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStep.scala
##########
@@ -22,23 +22,39 @@ import java.nio.charset.StandardCharsets
import com.google.common.io.Files
import io.fabric8.kubernetes.api.model.{ConfigMapBuilder, ContainerBuilder,
HasMetadata, PodBuilder}
-import org.apache.spark.deploy.k8s.{KubernetesConf, SparkPod}
+import org.apache.spark.deploy.k8s.{KubernetesConf, KubernetesUtils, SparkPod}
import org.apache.spark.deploy.k8s.Config._
import org.apache.spark.deploy.k8s.Constants._
+import org.apache.spark.internal.Logging
+import org.apache.spark.util.{Clock, SystemClock}
-private[spark] class PodTemplateConfigMapStep(conf: KubernetesConf)
- extends KubernetesFeatureConfigStep {
+private[spark] class PodTemplateConfigMapStep
+(conf: KubernetesConf, clock: Clock = new SystemClock())
+ extends KubernetesFeatureConfigStep with Logging {
private val hasTemplate = conf.contains(KUBERNETES_EXECUTOR_PODTEMPLATE_FILE)
+ private val preferredConfigmapName =
s"${conf.resourceNamePrefix}-$POD_TEMPLATE_CONFIGMAP"
+ private val resolvedConfigmapName =
+ if (preferredConfigmapName.length <= KUBERNETES_MAX_NAME_LENGTH) {
+ preferredConfigmapName
Review comment:
@yuj you are right the name is max 253 long according to this document:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
I shall remove the logic, I don't think we need to be defensive when the max
is this long.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]