in commands/action.go [522:544]
func augmentWebArg(cmd *cobra.Command, args []string, action *whisk.Action, augmentedAction *whisk.Action, existingAction *whisk.Action) (*whisk.Action, error) {
var err error
preserveAnnotations := action.Annotations == nil
if cmd.LocalFlags().Changed(WEB_FLAG) {
augmentedAction.Annotations, err = webAction(Flags.action.web, action.Annotations, action.Name, preserveAnnotations, existingAction)
if existingAction != nil && err == nil {
// Always carry forward any existing --web-secure annotation value
// Although it can be overwritten later if --web-secure is set
webSecureAnnotations := getWebSecureAnnotations(existingAction)
if len(webSecureAnnotations) > 0 {
augmentedAction.Annotations = augmentedAction.Annotations.AppendKeyValueArr(webSecureAnnotations)
}
}
}
if err != nil {
return nil, err
}
whisk.Debug(whisk.DbgInfo, "augmentWebArg: Augmented action struct: %#v\n", augmentedAction)
return augmentedAction, nil
}