Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/19717#discussion_r154871648
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -2744,6 +2744,25 @@ private[spark] object Utils extends Logging {
}
}
+ /**
+ * Check the validity of the given Kubernetes master URL and return the
resolved URL.
+ */
+ def checkAndGetK8sMasterUrl(rawMasterURL: String): String = {
+ require(rawMasterURL.startsWith("k8s://"),
+ "Kubernetes master URL must start with k8s://.")
+ val masterWithoutK8sPrefix = rawMasterURL.substring("k8s://".length)
+ if (masterWithoutK8sPrefix.startsWith("https://")) {
+ masterWithoutK8sPrefix
+ } else if (masterWithoutK8sPrefix.startsWith("http://")) {
+ logWarning("Kubernetes master URL uses HTTP instead of HTTPS.")
+ masterWithoutK8sPrefix
+ } else {
--- End diff --
Should this be happened only when scheme is not existed? From the code
looks like if user misconfigured with different scheme, the code will also be
executed here.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]