Skip to content

Commit e4e6cdd

Browse files
committed
Fixed the test using a master url without a scheme
1 parent 6726b11 commit e4e6cdd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

integration-test/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ private[spark] class KubernetesSuite extends FunSuite with BeforeAndAfterAll wit
7171

7272
test("Run SparkPi with a master URL without a scheme.") {
7373
val url = kubernetesTestComponents.kubernetesClient.getMasterUrl
74-
sparkAppConf.set("spark.master", s"k8s://${url.getHost}:${url.getPort}")
74+
val k8sMasterUrl = if (url.getPort < 0) {
75+
s"k8s://${url.getHost}"
76+
} else {
77+
s"k8s://${url.getHost}:${url.getPort}"
78+
}
79+
sparkAppConf.set("spark.master", k8sMasterUrl)
7580
runSparkPiAndVerifyCompletion()
7681
}
7782

0 commit comments

Comments
 (0)