Github user onursatici commented on a diff in the pull request:
https://github.com/apache/spark/pull/22146#discussion_r213846434
--- Diff:
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStepSuite.scala
---
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.deploy.k8s.features
+
+import java.io.{File, PrintWriter}
+import java.nio.file.Files
+
+import io.fabric8.kubernetes.api.model.ConfigMap
+import org.mockito.Mockito
+import org.scalatest.BeforeAndAfter
+
+import org.apache.spark.{SparkConf, SparkFunSuite}
+import org.apache.spark.deploy.k8s._
+
+class PodTemplateConfigMapStepSuite extends SparkFunSuite with
BeforeAndAfter {
+ private var sparkConf: SparkConf = _
+ private var kubernetesConf : KubernetesConf[_ <:
KubernetesRoleSpecificConf] = _
+ private var templateFile: File = _
+
+ before {
+ sparkConf = Mockito.mock(classOf[SparkConf])
+ kubernetesConf = KubernetesConf(
+ sparkConf,
+ KubernetesDriverSpecificConf(
+ None,
+ "app-name",
+ "main",
+ Seq.empty),
+ "resource",
+ "app-id",
+ Map.empty,
+ Map.empty,
+ Map.empty,
+ Map.empty,
+ Map.empty,
+ Nil,
+ Seq.empty[String])
+ templateFile = Files.createTempFile("pod-template", "yml").toFile
+ templateFile.deleteOnExit()
+ Mockito.doReturn(Option(templateFile.getAbsolutePath)).when(sparkConf)
+ .get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE)
+ }
+
+ test("Mounts executor template volume if config specified") {
--- End diff --
Because we need a kubernetesClient to be able to load a yaml file (not
ideal design decision from fabric8 for this case), I think we can only test
that in integration tests
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]