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

 ##########
 File path: tools/cli/go-whisk-cli/commands/action.go
 ##########
 @@ -505,16 +505,20 @@ func webActionAnnotations(
         var action *whisk.Action
         var err error
 
-        if annotations != nil || !fetchAnnotations {
-            annotations = webActionAnnotationMethod(annotations)
-        } else {
+        if fetchAnnotations {
             if action, _, err = client.Actions.Get(entityName); err != nil {
-                return nil, actionGetError(entityName, err)
+                whiskErr, isWhiskError := err.(*whisk.WskError)
+
+                if (isWhiskError && whiskErr.ExitCode != 
whisk.EXIT_CODE_NOT_FOUND) || !isWhiskError {
+                    return nil, actionGetError(entityName, err)
+                }
             } else {
-                annotations = webActionAnnotationMethod(action.Annotations)
+                annotations = append(annotations, action.Annotations...)
 
 Review comment:
   @mdeuser, given the situation when `annotations` and `action.Annotations` 
have a duplicate key, the value passed via the command-line with take 
precedence. That means the duplicate annotation already associated with the 
action will be overwritten with the new value.
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to