You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/09/25 23:46:53 UTC

[GitHub] asteed commented on a change in pull request #4035: Add support for allowedKinds limits in wskadmin

asteed commented on a change in pull request #4035: Add support for allowedKinds limits in wskadmin
URL: https://github.com/apache/incubator-openwhisk/pull/4035#discussion_r220389891
 
 

 ##########
 File path: tools/admin/src/main/scala/whisk/core/database/LimitsCommand.scala
 ##########
 @@ -64,11 +64,27 @@ class LimitsCommand extends Subcommand("limits") with WhiskCommand {
         validate = _ >= 0,
         name = "concurrentInvocations",
         noshort = true)
+    val allowedKinds =
+      opt[List[String]](
+        descr = "list of runtime kinds allowed in this namespace",
+        argName = "ALLOWEDKINDS",
+        name = "allowedKinds",
+        noshort = true,
+        default = None)
+
+    lazy val allowedKindSet = allowedKinds.toOption match {
+      case None       => None
+      case Some(list) => Some(list.toSet)
+    }
 
     lazy val limits: LimitEntity =
       new LimitEntity(
         EntityName(namespace()),
-        UserLimits(invocationsPerMinute.toOption, firesPerMinute.toOption, concurrentInvocations.toOption))
+        UserLimits(
+          invocationsPerMinute.toOption,
+          firesPerMinute.toOption,
+          concurrentInvocations.toOption,
+          allowedKindSet))
 
 Review comment:
   Thanks @chetanmeh, However it doesn't appear that `ScallopOption[List[String]]` has a `toSet` method whic was the reason for the explicit conversion. Am I missing something?
   ```> Task :tools:admin:compileScala
   /wrk/runtime/dev/openwhisk/tools/admin/src/main/scala/whisk/core/database/LimitsCommand.scala:82: value toSet is not a member of org.rogach.scallop.ScallopOption[List[String]]
             allowedKinds.toSet))
                          ^
   one error found
   
   > Task :tools:admin:compileScala FAILED
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services