SuccessChanges

Summary

  1. [SPARK-30970][K8S][CORE][2.4] Fix NPE while resolving k8s master url (details)
Commit ff5ba49794bb6281ec929a078a2218a2dbf67f5b by dhyun
[SPARK-30970][K8S][CORE][2.4] Fix NPE while resolving k8s master url
### What changes were proposed in this pull request?
backport https://github.com/apache/spark/pull/27721
``` bin/spark-sql --master
k8s:///https://kubernetes.docker.internal:6443 --conf
spark.kubernetes.container.image=yaooqinn/spark:v2.4.4 Exception in
thread "main" java.lang.NullPointerException
at
org.apache.spark.util.Utils$.checkAndGetK8sMasterUrl(Utils.scala:2739)
at
org.apache.spark.deploy.SparkSubmit.prepareSubmitEnvironment(SparkSubmit.scala:261)
at
org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:774)
at
org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:161)
at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
at
org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:920)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:929)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
``` Althrough `k8s:///https://kubernetes.docker.internal:6443` is a
wrong master url but should not throw npe The `case null` will never be
touched.
https://github.com/apache/spark/blob/3f4060c340d6bac412e8819c4388ccba226efcf3/core/src/main/scala/org/apache/spark/util/Utils.scala#L2772-L2776
### Why are the changes needed?
bug fix
### Does this PR introduce any user-facing change?
no
### How was this patch tested?
add ut case
Closes #27736 from yaooqinn/SPARK-30970-2.
Authored-by: Kent Yao <yaooqinn@hotmail.com> Signed-off-by: Dongjoon
Hyun <dhyun@apple.com>
The file was modifiedcore/src/main/scala/org/apache/spark/util/Utils.scala (diff)
The file was modifiedcore/src/test/scala/org/apache/spark/util/UtilsSuite.scala (diff)