(cmd *cobra.Command, args []string, action *whisk.Action, augmentedAction *whisk.Action, existingAction *whisk.Action)
| 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 |
| 524 | preserveAnnotations := action.Annotations == nil |
| 525 | |
| 526 | if cmd.LocalFlags().Changed(WEB_FLAG) { |
| 527 | augmentedAction.Annotations, err = webAction(Flags.action.web, action.Annotations, action.Name, preserveAnnotations, existingAction) |
| 528 | if existingAction != nil && err == nil { |
| 529 | // Always carry forward any existing --web-secure annotation value |
| 530 | // Although it can be overwritten later if --web-secure is set |
| 531 | webSecureAnnotations := getWebSecureAnnotations(existingAction) |
| 532 | if len(webSecureAnnotations) > 0 { |
| 533 | augmentedAction.Annotations = augmentedAction.Annotations.AppendKeyValueArr(webSecureAnnotations) |
| 534 | } |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | if err != nil { |
| 539 | return nil, err |
| 540 | } |
| 541 | |
| 542 | whisk.Debug(whisk.DbgInfo, "augmentWebArg: Augmented action struct: %#v\n", augmentedAction) |
| 543 | return augmentedAction, nil |
| 544 | } |
| 545 | |
| 546 | /* |
| 547 | * Return a whisk.Action augmented with --web-secure annotation updates |
no test coverage detected