Skip to content

Commit

Permalink
Remove now-unneeded reflection (#894)
Browse files Browse the repository at this point in the history
* Remove now-unneeded reflection

Since we can now require Akka 2.6.14

Refs #830

* Remove test for now-disappeared scenario

* Make version in pom consistent as well

Doh
  • Loading branch information
raboof authored May 3, 2021
1 parent 12a6933 commit 07d8486
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,8 @@ object ClusterHttpManagementRoutes extends ClusterHttpManagementJsonProtocol {
put {
formField('operation) { operation =>
if (operation.toLowerCase == "prepare-for-full-shutdown") {
try {
// FIXME once we move to Akka 2.6 https://github.com/akka/akka-management/issues/830
val m = cluster.getClass.getMethod("prepareForFullClusterShutdown")
m.invoke(cluster)
complete(ClusterHttpManagementMessage(s"Preparing for full cluster shutdown"))
} catch {
case NonFatal(_) =>
complete(StatusCodes.BadRequest, "prepare-for-full-shutdown not supported in this Akka version")
}
cluster.prepareForFullClusterShutdown()
complete(ClusterHttpManagementMessage(s"Preparing for full cluster shutdown"))
} else {
complete(StatusCodes.BadRequest -> ClusterHttpManagementMessage("Operation not supported"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ class ClusterHttpManagementRoutesSpec
val version = new Version("1.42")

"Http Cluster Management Routes" should {
"prepare cluster for shutdown" when {
"calling PUT on /cluster/ in an unsupported akka version" in {
val mockedCluster = mock(classOf[Cluster])
Put("/cluster/", FormData("operation" -> "prepare-for-full-shutdown")) ~> ClusterHttpManagementRoutes(
mockedCluster) ~> check {
// at least makes sure the path matching works
status shouldEqual StatusCodes.BadRequest
}
}
}

"return list of members with cluster leader and oldest" when {
"calling GET /cluster/members" in {
val dcName = "one"
Expand Down
2 changes: 1 addition & 1 deletion integration-test/kubernetes-api-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<akka.version>2.6.10</akka.version>
<akka.version>2.6.14</akka.version>
<akka.http.version>10.1.11</akka.http.version>
<akka-management.version>1.0.5</akka-management.version>
<scala.binary.version>2.12</scala.binary.version>
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Dependencies {
val CrossScalaVersions = Seq(Dependencies.Scala212, Dependencies.Scala213)

// Align the versions in integration-test/kubernetes-api-java/pom.xml
val AkkaVersion = "2.6.10"
val AkkaVersion = "2.6.14"
val AkkaBinaryVersion = "2.6"
// Align the versions in integration-test/kubernetes-api-java/pom.xml
val AkkaHttp101 = "10.1.11"
Expand Down

0 comments on commit 07d8486

Please sign in to comment.