markusthoemmes commented on a change in pull request #3391: Add 
namespace-blacklist to invoker.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3391#discussion_r172624728
 
 

 ##########
 File path: 
ansible/files/namespace_throttlings_design_document_for_subjects_db.json
 ##########
 @@ -0,0 +1,10 @@
+{
+  "_id": "_design/namespaceThrottlings",
+  "views": {
+    "blockedNamespaces": {
+      "map": "function (doc) {\n  if (doc._id.indexOf(\"/limits\") >= 0) {\n   
 if (doc.concurrentInvocations === 0 || doc.invocationsPerMinute === 0) {\n     
 var namespace = doc._id.replace(\"/limits\", \"\");\n      emit(namespace, 
1);\n    }\n  } else if (doc.subject && doc.namespaces && doc.blocked) {\n    
doc.namespaces.forEach(function(namespace) {\n      emit(namespace.name, 1);\n  
  });\n  }\n}",
 
 Review comment:
   I don't think so. Slashes are generally not allowed in namespaces so a 
namespace cannot possibly start with it.
   
   The better check here would've been an `endWith` (ofcourse we'd need to 
emulate it through an indexOf + offset check). But we decided against that for 
improved readability.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to