mdeuser 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_r124616535
 
 

 ##########
 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:
   If `annotations` and `action.Annotations` each define the same annotation, I 
think the returned `annotations` slice will have that annotation defined twice, 
with the existing annotation value appearing ordinally after the updated value. 
 If so, will downstream consumers select the first or last annotation 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