holdenk commented on a change in pull request #30751:
URL: https://github.com/apache/spark/pull/30751#discussion_r546035030
##########
File path:
resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/backend/minikube/Minikube.scala
##########
@@ -56,60 +64,103 @@ private[spark] object Minikube extends Logging {
if (oldMinikube.isEmpty) {
getIfNewMinikubeStatus(statusString)
} else {
- val finalStatusString = oldMinikube
- .head
- .replaceFirst(MINIKUBE_VM_PREFIX, "")
- .replaceFirst(MINIKUBE_PREFIX, "")
+ val statusLine = oldMinikube.head
+ val finalStatusString = if (statusLine.contains(MINIKUBE_VM_PREFIX)) {
+ statusLine.split(MINIKUBE_VM_PREFIX)(1)
+ } else {
+ statusLine.split(MINIKUBE_PREFIX)(1)
+ }
MinikubeStatus.unapply(finalStatusString)
.getOrElse(throw new IllegalStateException(s"Unknown status
$statusString"))
}
}
def getKubernetesClient: DefaultKubernetesClient = {
+ val versionArrayOpt = "\\d+\\.\\d+\\.\\d+".r
Review comment:
Just for the next reviewer or code reader maybe add a comment about how
the minikube version string sometimes containers a non-numeric suffix and this
is intentionally being dropped by this regex.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]