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

    https://github.com/apache/spark/pull/19717#discussion_r155956779
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2744,6 +2744,42 @@ private[spark] object Utils extends Logging {
         }
       }
     
    +  /**
    +   * Check the validity of the given Kubernetes master URL and return the 
resolved URL. Prefix
    +   * "k8s:" is appended to the resolved URL as the prefix is used by 
KubernetesClusterManager
    +   * in canCreate to determine if the KubernetesClusterManager should be 
used.
    +   */
    +  def checkAndGetK8sMasterUrl(rawMasterURL: String): String = {
    +    require(rawMasterURL.startsWith("k8s://"),
    +      "Kubernetes master URL must start with k8s://.")
    +    val masterWithoutK8sPrefix = rawMasterURL.substring("k8s://".length)
    +
    +    // To handle master URLs, e.g., k8s://host:port.
    +    if (!masterWithoutK8sPrefix.contains("://")) {
    --- End diff --
    
    startsWith instead of contains?


---

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

Reply via email to