Skip to content

Commit

Permalink
Merge pull request #514 from carolynvs/invoke-persist-outputs
Browse files Browse the repository at this point in the history
Write claim outputs on invoke
  • Loading branch information
carolynvs-msft authored Aug 14, 2019
2 parents b4f1ef4 + f1eb1a2 commit a5e6ef9
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 a5e6ef9

Please sign in to comment.