holdenk commented on a change in pull request #30751:
URL: https://github.com/apache/spark/pull/30751#discussion_r546035284
##########
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
+ .findFirstIn(minikubeVersionString.split(VERSION_PREFIX)(1))
+ .map(_.split('.').map(_.toInt))
+
+ assert(versionArrayOpt.isDefined && versionArrayOpt.get.size == 3,
+ "Unexpected minikube version format: a three-part version number is
expected")
Review comment:
Maybe print out the version string for debugging this error if it ever
happens.
----------------------------------------------------------------
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]