Ensure policy events do not cause a panic when using preview --json (#5610)

This commit is contained in:
Paul Stack 2020-10-22 20:28:39 +01:00 committed by GitHub
parent ec9c02f578
commit b75ca2602f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,10 @@ CHANGELOG
## HEAD (Unreleased)
- [cli] Ensure that the CLI doesn't panic when using pulumi watch and policies are enabled
[#5569](https://github.com/pulumi/pulumi/pull/5569)
- [cli] Ensure that the CLI doesn't panic when using the JSON output as part of previews
and policies are enabled
[#5610](https://github.com/pulumi/pulumi/pull/5610)
## 2.12.0 (2020-10-14)

View file

@ -181,6 +181,9 @@ func ShowJSONEvents(op string, action apitype.UpdateKind, events <-chan engine.E
// need to come up with a scheme for matching the failure to the associated step.
// Events ocurring late:
case engine.PolicyViolationEvent:
// At this point in time, we don't handle policy events in JSON serialization
continue
case engine.SummaryEvent:
// At the end of the preview, a summary event indicates the final conclusions.
p := e.Payload().(engine.SummaryEventPayload)