Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20910#discussion_r177273458
  
    --- Diff: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkPod.scala
 ---
    @@ -14,17 +14,16 @@
      * See the License for the specific language governing permissions and
      * limitations under the License.
      */
    -package org.apache.spark.deploy.k8s.submit.steps
    +package org.apache.spark.deploy.k8s
     
    -import org.apache.spark.deploy.k8s.submit.KubernetesDriverSpec
    +import io.fabric8.kubernetes.api.model.{Container, ContainerBuilder, Pod, 
PodBuilder}
     
    -/**
    - * Represents a step in configuring the Spark driver pod.
    - */
    -private[spark] trait DriverConfigurationStep {
    +private[spark] case class SparkPod(pod: Pod, container: Container)
     
    -  /**
    -   * Apply some transformation to the previous state of the driver to add 
a new feature to it.
    -   */
    -  def configureDriver(driverSpec: KubernetesDriverSpec): 
KubernetesDriverSpec
    +private[spark] object SparkPod {
    +  def initialPod(): SparkPod = {
    +    SparkPod(
    +      new 
PodBuilder().withNewMetadata().endMetadata().withNewSpec().endSpec().build(),
    --- End diff --
    
    Sort of. It allows everything that consumes one of these to use 
`.editMetadata()` or `editOrNewMetadata` when creating features. If you don't 
initialize the metadata and spec and then a downstream caller tries to invoke 
`editMetadata` then we throw an NPE.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to