MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / augmentAction

Function augmentAction

commands/action.go:492–520  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string, action *whisk.Action, update bool)

Source from the content-addressed store, hash-verified

490}
491
492func augmentAction(cmd *cobra.Command, args []string, action *whisk.Action, update bool) (*whisk.Action, error) {
493 var err error
494 var existingAction *whisk.Action = nil
495 var augmentedAction *whisk.Action = new(whisk.Action)
496 *augmentedAction = *action
497
498 if update {
499 if existingAction, _, err = Client.Actions.Get(action.Name, DO_NOT_FETCH_CODE); err != nil {
500 whiskErr, isWhiskError := err.(*whisk.WskError)
501
502 if (isWhiskError && whiskErr.ExitCode != whisk.EXIT_CODE_NOT_FOUND) || !isWhiskError {
503 return nil, actionGetError(action.Name, DO_NOT_FETCH_CODE, err)
504 }
505 }
506 }
507
508 // Augment the action's annotations with the --web related annotations
509 if augmentedAction, err = augmentWebArg(cmd, args, action, augmentedAction, existingAction); err != nil {
510 return nil, err
511 }
512
513 // Augment the action's annotations with the --web-secure related annotations
514 if augmentedAction, err = augmentWebSecureArg(cmd, args, action, augmentedAction, existingAction); err != nil {
515 return nil, err
516 }
517
518 whisk.Debug(whisk.DbgInfo, "Augmented action struct: %#v\n", augmentedAction)
519 return augmentedAction, err
520}
521
522func augmentWebArg(cmd *cobra.Command, args []string, action *whisk.Action, augmentedAction *whisk.Action, existingAction *whisk.Action) (*whisk.Action, error) {
523 var err error

Callers 1

action.goFile · 0.85

Calls 4

actionGetErrorFunction · 0.85
augmentWebArgFunction · 0.85
augmentWebSecureArgFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected