You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/30 13:36:46 UTC

[GitHub] dubeejw commented on a change in pull request #2435: Ensure Action Update Creates a Web Action (Review)

dubeejw commented on a change in pull request #2435: Ensure Action Update Creates a Web Action (Review)
URL: https://github.com/apache/incubator-openwhisk/pull/2435#discussion_r125040283
 
 

 ##########
 File path: tools/cli/go-whisk-cli/commands/util.go
 ##########
 @@ -473,6 +473,26 @@ func addKeyValue(key string, value interface{}, keyValueArr whisk.KeyValueArr) (
     return append(keyValueArr, keyValue)
 }
 
+func findKeyValue(keyValueArr whisk.KeyValueArr, key string) (int) {
+    for i := 0; i < len(keyValueArr); i++ {
+        if strings.ToLower(keyValueArr[i].Key) == strings.ToLower(key) {
+            return i
+        }
+    }
+
+    return -1
+}
+
+func appendKeyValueArr(origKeyValueArr whisk.KeyValueArr, appKeyValueArr whisk.KeyValueArr) (whisk.KeyValueArr) {
+    for i := 0; i < len(appKeyValueArr); i++ {
+        if findKeyValue(origKeyValueArr, appKeyValueArr[i].Key) == -1 {
 
 Review comment:
   @mdeuser, from the function call in action.go, the first argument is the new annotations to be added while the second argument passed is the existing annotations for a fetched action. Given that order of arguments, existing annotations will be overwritten. 
 
----------------------------------------------------------------
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