ningyougang commented on a change in pull request #4917:
URL: https://github.com/apache/openwhisk/pull/4917#discussion_r504522510
##########
File path:
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala
##########
@@ -176,6 +184,63 @@ class Controller(val instance: ControllerInstanceId,
LogLimit.config,
runtimes,
List(apiV1.basepath()))
+
+ private val controllerCredentials =
loadConfigOrThrow[ControllerCredentials](ConfigKeys.controllerCredentials)
+
+ /**
+ * config user memory of ContainerPool
+ */
+ private val configMemory = {
+ implicit val executionContext = actorSystem.dispatcher
+ (path("config" / "memory") & post) {
+ extractCredentials {
+ case Some(BasicHttpCredentials(username, password)) =>
+ if (username == controllerCredentials.username && password ==
controllerCredentials.password) {
+ entity(as[String]) { memory =>
+ try {
+ val userMemoryMessage =
ByteSizeMessage(ByteSize.fromString(memory))
+ if (userMemoryMessage.userMemory.size == 0) {
Review comment:
Updated accordingly, the user meomry can't be less than `MemoryLimit.min`
----------------------------------------------------------------
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]