(cmd *cobra.Command, args []string, action *whisk.Action, update bool)
| 490 | } |
| 491 | |
| 492 | func 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 | |
| 522 | func augmentWebArg(cmd *cobra.Command, args []string, action *whisk.Action, augmentedAction *whisk.Action, existingAction *whisk.Action) (*whisk.Action, error) { |
| 523 | var err error |
no test coverage detected