ningyougang commented on a change in pull request #4790: Add administrative
interface to invoker and controller to reconfigure runtimes
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r385010928
##########
File path:
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala
##########
@@ -163,6 +171,56 @@ class Controller(val instance: ControllerInstanceId,
LogLimit.config,
runtimes,
List(apiV1.basepath()))
+
+ private val controllerCredentials =
loadConfigOrThrow[ControllerCredentials](ConfigKeys.controllerCredentials)
+
+ /**
+ * config runtime
+ */
+ private val configRuntime = {
+ implicit val executionContext = actorSystem.dispatcher
+ (path("config" / "runtime") & post) {
+ extractCredentials {
+ case Some(BasicHttpCredentials(username, password)) =>
+ if (username == controllerCredentials.username && password ==
controllerCredentials.password) {
+ entity(as[String]) { runtime =>
+ val execManifest = ExecManifest.initialize(runtime)
+ if (execManifest.isFailure) {
Review comment:
I just follow other codes using `execManifest.isFailure` to judge whether
success or fail
----------------------------------------------------------------
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]
With regards,
Apache Git Services