Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 8cb9a92

Browse files
Kerry Changstarpit
authored andcommitted
update create to work with composer v4
1 parent f95d21b commit 8cb9a92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/plugins/modules/composer/lib/composer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,10 @@ exports.create = ({name, fsm, type, annotations=[], parameters=[], wsk, commandT
464464
])
465465
.then(([currentAction]) => {
466466
// now we merge together the parameters and annotations
467-
const fsmAction = openwhiskComposer.encode(openwhiskComposer.composition(fqnAppName, fsm), "0.4.0").actions[0].action
467+
let encodeElement = openwhiskComposer.encode(openwhiskComposer.composition(fqnAppName, fsm), "0.4.0")
468+
// multiple actions might be returned, as people can now use composer combinators to deploy new actions
469+
// currently, the main composition action is always the last action in the array
470+
const fsmAction = encodeElement.actions[encodeElement.actions.length ? encodeElement.actions.length - 1 : 0].action
468471
fsmAction.parameters = currentAction.parameters.concat(parameters).concat(fsmAction.parameters || []),
469472
fsmAction.annotations = mergeAnnotations(currentAction.annotations,
470473
mergeAnnotations(annotations||[], fsmAction.annotations||[]),

0 commit comments

Comments
 (0)