Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #85
The reason the panic happened was due to a mismatch between the properties produced by
Read
and the properties expected byDiff
. You can see the difference in output states in more detail below, but the TL;DR is that we were adding an extra object with the key__inputs
in our output property map uponCreate
andUpdate
.Read
did not stuff values into the__inputs
object after reading.In order to simplify things, I lifted every key we previously stored in
__inputs
to the top level, while still handling the old state. So when users upgrade to this new version, onpulumi up
orpulumi refresh
, they will see a diff as if we are adding additional output properties, and removing old properties. We don't do this__inputs
thing in any other providers (Seepulumi-command
for example)Additionally, I upgraded examples/go.mod to
go1.19
so that I could upgrade our pinned version ofpulumi/pulumi/sdk
andpulumi/pulumi/pkg
.State
Before This PR
Before Refresh:
After Refresh
After This PR
(Still handles old state where
__inputs
was defined)Testing
Manual verification of upgrade
v0.1.6 --> PR version, with
refresh
v0.1.6
version of the pulumi-service provider.pulumi up
inexamples/yaml-webhooks
.pulumi refresh
pulumi up
pulumi up
ran successfully and lifted values from__inputs
to top-level outputsv0.1.6 --> PR version, without
refresh
on v0.1.6v0.1.6
version of the pulumi-service provider.pulumi up
inexamples/yaml-webhooks
.pulumi up
pulumi up
ran successfully and lifted values from__inputs
to top-level outputs