Skip to content

Commit 8444e58

Browse files
committed
Fix typo
1 parent a49c0a3 commit 8444e58

File tree

11 files changed

+57
-34
lines changed

11 files changed

+57
-34
lines changed

ansible/roles/controller/tasks/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@
384384
return_content: yes
385385
register: result
386386
until: result.content == '0'
387-
retries: {{ controller.deployment.retries }}
388-
delay: {{ controller.deployment.delay }}
387+
retries: "{{ controller.deployment.retries }}"
388+
delay: "{{ controller.deployment.delay }}"
389389
when: zeroDowntimeDeployment.enabled == true and controllerDeployed.stdout != "0" and (zeroDowntimeDeployment.solution == 'apicall')
390390
ignore_errors: "{{ controller.deployment.ignore_error }}"
391391

ansible/roles/invoker/tasks/clean.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
return_content: yes
4646
register: result
4747
until: result.content == '0'
48-
retries: {{ invoker.deployment.retries }}
49-
delay: {{ invoker.deployment.delay }}
48+
retries: "{{ invoker.deployment.retries }}"
49+
delay: "{{ invoker.deployment.delay }}"
5050
when: zeroDowntimeDeployment.enabled == true and enable_scheduler
5151
ignore_errors: "{{ invoker.deployment.ignore_error }}"
5252

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,30 @@ class FunctionPullingContainerPool(
415415
adjustPrewarmedContainer(false, true)
416416

417417
case StatusQuery =>
418-
val result = immutable.Map.empty[String, List[String]]
418+
var result = immutable.Map.empty[String, List[String]]
419419
val pools = busyPool ++ warmedPool ++ inProgressPool
420420
pools.foreach { entry =>
421421
entry._2 match {
422422
case InitializedData(container, _, action, _) =>
423-
result += (action.fullyQualifiedName(true).asString, container.containerId.asString)
423+
val key = action.fullyQualifiedName(true).asString
424+
var list = result.getOrElse(key, List.empty[String])
425+
list = container.containerId.asString :: list
426+
result += (action.fullyQualifiedName(true).asString -> list)
424427
case WarmData(container, _, action, _, _, _) =>
425-
result += (action.fullyQualifiedName(true).asString, container.containerId.asString)
428+
val key = action.fullyQualifiedName(true).asString
429+
var list = result.getOrElse(key, List.empty[String])
430+
list = container.containerId.asString :: list
431+
result += (action.fullyQualifiedName(true).asString -> list)
426432
case ContainerCreatedData(container, _, action) =>
427-
result += (action.fullyQualifiedName(true).asString, container.containerId.asString)
433+
val key = action.fullyQualifiedName(true).asString
434+
var list = result.getOrElse(key, List.empty[String])
435+
list = container.containerId.asString :: list
436+
result += (action.fullyQualifiedName(true).asString -> list)
428437
case ReschedulingData(container, _, action, _, _) =>
429-
result += (action.fullyQualifiedName(true).asString, container.containerId.asString)
438+
val key = action.fullyQualifiedName(true).asString
439+
var list = result.getOrElse(key, List.empty[String])
440+
list = container.containerId.asString :: list
441+
result += (action.fullyQualifiedName(true).asString -> list)
430442
case _ => // do nothing
431443
}
432444
}

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ class DefaultInvokerServer(val invoker: InvokerCore, systemUsername: String, sys
4646
super.routes ~ extractCredentials {
4747
case Some(BasicHttpCredentials(username, password)) if username == systemUsername && password == systemPassword =>
4848
(path("enable") & post) {
49-
invoker.enable()
49+
complete(invoker.enable())
5050
} ~ (path("disable") & post) {
51-
invoker.disable()
51+
complete(invoker.disable())
5252
} ~ (path("isEnabled") & get) {
53-
invoker.isEnabled()
53+
complete(invoker.isEnabled())
5454
}
5555
case _ => terminate(StatusCodes.Unauthorized)
5656
}

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ import org.apache.openwhisk.core.connector._
3333
import org.apache.openwhisk.core.containerpool._
3434
import org.apache.openwhisk.core.containerpool.logging.LogStoreProvider
3535
import org.apache.openwhisk.core.containerpool.v2._
36-
import org.apache.openwhisk.core.database.{UserContext, _}
36+
import org.apache.openwhisk.core.database._
3737
import org.apache.openwhisk.core.entity._
3838
import org.apache.openwhisk.core.etcd.EtcdKV.ContainerKeys.containerPrefix
3939
import org.apache.openwhisk.core.etcd.EtcdKV.QueueKeys.queue
4040
import org.apache.openwhisk.core.etcd.EtcdKV.{ContainerKeys, SchedulerKeys}
4141
import org.apache.openwhisk.core.etcd.EtcdType._
4242
import org.apache.openwhisk.core.etcd.{EtcdClient, EtcdConfig, EtcdWorker}
4343
import org.apache.openwhisk.core.invoker.Invoker.InvokerEnabled
44-
import org.apache.openwhisk.core.scheduler.queue.QueueSize
4544
import org.apache.openwhisk.core.scheduler.{SchedulerEndpoints, SchedulerStates}
4645
import org.apache.openwhisk.core.service.{DataManagementService, LeaseKeepAliveService, WatcherService}
4746
import org.apache.openwhisk.core.{ConfigKeys, WarmUp, WhiskConfig}

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package org.apache.openwhisk.core.invoker
2020
import akka.actor.ActorSystem
2121
import akka.http.scaladsl.model.StatusCodes
2222
import akka.http.scaladsl.model.headers.BasicHttpCredentials
23-
import akka.http.scaladsl.server.Directives.complete
2423
import akka.http.scaladsl.server.Route
2524
import org.apache.openwhisk.common.{Logging, TransactionId}
2625
import org.apache.openwhisk.core.ConfigKeys

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
package org.apache.openwhisk.core.invoker
1919

20-
import java.nio.charset.StandardCharsets
21-
import java.time.Instant
2220
import akka.Done
2321
import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, CoordinatedShutdown, Props}
2422
import akka.event.Logging.InfoLevel
@@ -30,10 +28,8 @@ import org.apache.openwhisk.core.ack.{MessagingActiveAck, UserEventSender}
3028
import org.apache.openwhisk.core.connector._
3129
import org.apache.openwhisk.core.containerpool._
3230
import org.apache.openwhisk.core.containerpool.logging.LogStoreProvider
33-
import org.apache.openwhisk.core.containerpool.v2.Data
34-
import org.apache.openwhisk.core.database.{UserContext, _}
31+
import org.apache.openwhisk.core.database._
3532
import org.apache.openwhisk.core.entity._
36-
import org.apache.openwhisk.core.entity.size._
3733
import org.apache.openwhisk.core.invoker.Invoker.InvokerEnabled
3834
import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig}
3935
import org.apache.openwhisk.http.Messages
@@ -42,6 +38,8 @@ import pureconfig._
4238
import pureconfig.generic.auto._
4339
import spray.json._
4440

41+
import java.nio.charset.StandardCharsets
42+
import java.time.Instant
4543
import scala.collection.immutable
4644
import scala.concurrent.duration._
4745
import scala.concurrent.{ExecutionContext, Future}

tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerTestCommon.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class DegenerateLoadBalancerService(config: WhiskConfig)(implicit ec: ExecutionC
320320
override def totalActiveActivations = Future.successful(0)
321321
override def activeActivationsFor(namespace: UUID) = Future.successful(0)
322322
override def activeActivationsByController(controller: String): Future[Int] = Future.successful(0)
323-
override def activeActivationsByController: Future[List[ActivationId]] = Future.successful(List(ActivationId("id")))
323+
override def activeActivationsByController: Future[List[(String, String)]] = Future.successful(List(("", "")))
324324
override def activeActivationsByInvoker(invoker: String): Future[Int] = Future.successful(0)
325325

326326
override def publish(action: ExecutableWhiskActionMetaData, msg: ActivationMessage)(

tests/src/test/scala/org/apache/openwhisk/core/invoker/test/DefaultInvokerServerTests.scala

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import org.scalamock.scalatest.MockFactory
3232
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers}
3333
import org.scalatest.junit.JUnitRunner
3434

35+
import scala.concurrent.Future
36+
3537
/**
3638
* Tests InvokerServer API.
3739
*/
@@ -135,24 +137,29 @@ class TestInvokerReactive extends InvokerCore with BasicHttpService {
135137
var enableCount = 0
136138
var disableCount = 0
137139

138-
override def enable(): Route = {
140+
override def enable(): String = {
139141
enableCount += 1
140-
complete("")
142+
s""
141143
}
142144

143-
override def disable(): Route = {
145+
override def disable(): String = {
144146
disableCount += 1
145-
complete("")
147+
s""
146148
}
147149

148-
override def isEnabled(): Route = {
150+
override def isEnabled(): String = {
149151
complete(InvokerEnabled(true).serialize())
152+
s""
150153
}
151154

152155
override def backfillPrewarm(): Route = {
153156
complete("")
154157
}
155158

159+
override def status(): Future[Map[String, List[String]]] = {
160+
Future.successful(Map.empty[String, List[String]])
161+
}
162+
156163
def reset(): Unit = {
157164
enableCount = 0
158165
disableCount = 0

tests/src/test/scala/org/apache/openwhisk/core/invoker/test/FPCInvokerServerTests.scala

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import org.scalamock.scalatest.MockFactory
3232
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers}
3333
import org.scalatest.junit.JUnitRunner
3434

35+
import scala.concurrent.Future
36+
3537
/**
3638
* Tests InvokerServerV2 API.
3739
*/
@@ -134,24 +136,29 @@ class TestFPCInvokerReactive extends InvokerCore with BasicHttpService {
134136
var enableCount = 0
135137
var disableCount = 0
136138

137-
override def enable(): Route = {
139+
override def enable(): String = {
138140
enableCount += 1
139-
complete("")
141+
""
140142
}
141143

142-
override def disable(): Route = {
144+
override def disable(): String = {
143145
disableCount += 1
144-
complete("")
146+
""
145147
}
146148

147-
override def isEnabled(): Route = {
149+
override def isEnabled(): String = {
148150
complete(InvokerEnabled(true).serialize())
151+
""
149152
}
150153

151154
override def backfillPrewarm(): Route = {
152155
complete("")
153156
}
154157

158+
override def status(): Future[Map[String, List[String]]] = {
159+
Future.successful(Map.empty[String, List[String]])
160+
}
161+
155162
def reset(): Unit = {
156163
enableCount = 0
157164
disableCount = 0

0 commit comments

Comments
 (0)