Skip to content

Commit

Permalink
write claim outputs on invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynvs-msft committed Aug 14, 2019
1 parent a1bb115 commit f1eb1a2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/cnab/provider/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@ func (d *Duffle) Invoke(action string, args ActionArguments) error {
}

// Run the action and ALWAYS write out a claim, even if the action fails
err = i.Run(&claim, creds, d.Out)
runErr := i.Run(&claim, creds, d.Out)

// Add/update the outputs section of a claim and capture error
err = d.WriteClaimOutputs(&claim, action)

// ALWAYS write out a claim, even if the action fails
saveErr := claims.Store(claim)
if runErr != nil {
return errors.Wrap(runErr, "failed to invoke the bundle")
}
if err != nil {
return errors.Wrap(err, "failed to invoke the bundle")
return errors.Wrap(err, "failed to write outputs to the claim")
}
return errors.Wrap(saveErr, "failed to record the updated claim for the bundle")
}

0 comments on commit f1eb1a2

Please sign in to comment.