Skip to content

Commit 8279c90

Browse files
authored
Specify RefreshBeforeUpdate on partial failures (#424)
This PR updates dependencies to pulumi v3.178.0 and specifies RefreshBeforeUpdate on partial failures (which is now supported in v3.178.0). Previously, it was only possible to indicate RefreshBeforeUpdate on successful provider operations. With this, if a Module CustomResource partially fails during Create (e.g. one of it's children has failed), as part of reporting a partial failure using `ErrorResourceInitFailed`, it can now indicate that it should be refreshed by default. This way, on the next `pulumi up`, the Module resource will be refreshed as intended, giving the Module resource an opportunity to "retry" for any of the failed children.
1 parent 79259e0 commit 8279c90

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ require (
3030
github.com/pulumi/opentofu v0.0.0-20250318202137-3146daceaf73
3131
github.com/pulumi/providertest v0.3.0
3232
github.com/pulumi/pulumi-terraform-bridge/v3 v3.108.0
33-
github.com/pulumi/pulumi/pkg/v3 v3.177.0
34-
github.com/pulumi/pulumi/sdk/v3 v3.177.0
33+
github.com/pulumi/pulumi/pkg/v3 v3.178.0
34+
github.com/pulumi/pulumi/sdk/v3 v3.178.0
3535
github.com/stretchr/testify v1.10.0
3636
github.com/zclconf/go-cty v1.16.2
3737
google.golang.org/grpc v1.72.1
@@ -203,7 +203,7 @@ require (
203203
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
204204
github.com/pmezard/go-difflib v1.0.0 // indirect
205205
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
206-
github.com/pulumi/esc v0.14.2 // indirect
206+
github.com/pulumi/esc v0.14.3 // indirect
207207
github.com/pulumi/inflector v0.1.1 // indirect
208208
github.com/rivo/uniseg v0.4.4 // indirect
209209
github.com/rogpeppe/go-internal v1.13.1 // indirect

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
774774
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
775775
github.com/pgavlin/fx v0.1.6 h1:r9jEg69DhNoCd3Xh0+5mIbdbS3PqWrVWujkY76MFRTU=
776776
github.com/pgavlin/fx v0.1.6/go.mod h1:KWZJ6fqBBSh8GxHYqwYCf3rYE7Gp2p0N8tJp8xv9u9M=
777+
github.com/pgavlin/fx/v2 v2.0.3 h1:ZBVklTFjxcWvBVPE+ti5qwnmTIQ0Gq6nuj3J5RKDtKk=
778+
github.com/pgavlin/fx/v2 v2.0.3/go.mod h1:Cvnwqq0BopdHUJ7CU50h1XPeKrF4ZwdFj1nJLXbAjCE=
777779
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 h1:LoCV5cscNVWyK5ChN/uCoIFJz8jZD63VQiGJIRgr6uo=
778780
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386/go.mod h1:MRxHTJrf9FhdfNQ8Hdeh9gmHevC9RJE/fu8M3JIGjoE=
779781
github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4=
@@ -793,8 +795,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
793795
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
794796
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0=
795797
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE=
796-
github.com/pulumi/esc v0.14.2 h1:xHpjJXzKs1hk/QPpgwe1Rmif3VWA0QcZ7jDvTFYX/jM=
797-
github.com/pulumi/esc v0.14.2/go.mod h1:0dNzCWIiRUmdfFrhHdeBzU4GiDPBhSfpeWDNApZwZ08=
798+
github.com/pulumi/esc v0.14.3 h1:Zli+9LiSDT/W+Fsfr8tITxCo+5wn969tLrE4KLv44G8=
799+
github.com/pulumi/esc v0.14.3/go.mod h1:XnSxlt5NkmuAj304l/gK4pRErFbtqq6XpfX1tYT9Jbc=
798800
github.com/pulumi/inflector v0.1.1 h1:dvlxlWtXwOJTUUtcYDvwnl6Mpg33prhK+7mzeF+SobA=
799801
github.com/pulumi/inflector v0.1.1/go.mod h1:HUFCjcPTz96YtTuUlwG3i3EZG4WlniBvR9bd+iJxCUY=
800802
github.com/pulumi/opentofu v0.0.0-20250318202137-3146daceaf73 h1:1Cld5Dmfe0s5bfNByLFkyipLkWTZE9MO34jVkfPhg/c=
@@ -803,10 +805,10 @@ github.com/pulumi/providertest v0.3.0 h1:Dv10aoFaNQBDRtK8cRbd2uk9vEhpC/NryN+0y7N
803805
github.com/pulumi/providertest v0.3.0/go.mod h1:aTxVfdxP/Pe0iPbokjBp99x0XaY4fkZB2CjIS5wysMs=
804806
github.com/pulumi/pulumi-terraform-bridge/v3 v3.108.0 h1:ypXrqGaIe652X51dTlJSVW9JdzNYsns3yKp+6C+KF5w=
805807
github.com/pulumi/pulumi-terraform-bridge/v3 v3.108.0/go.mod h1:OURQCCIz/jBcXs1oUsL38P5SamBGc2HJBCcmva4LJi4=
806-
github.com/pulumi/pulumi/pkg/v3 v3.177.0 h1:ia1F+KJI5atHRiaoC9J+d5dGVjiVrHsAdHjpkprIivI=
807-
github.com/pulumi/pulumi/pkg/v3 v3.177.0/go.mod h1:xUW/FZGNemCO+aTqlKoRGbLE1Bq+2uOFbmTW5OD1Hnk=
808-
github.com/pulumi/pulumi/sdk/v3 v3.177.0 h1:k3CEjq+EJsCGOmAPxjEwNEsAFaRoqQzzlti4aqrrLBA=
809-
github.com/pulumi/pulumi/sdk/v3 v3.177.0/go.mod h1:AD2BrIxFG4wdCLCFODrOasXhURwrD/8hHrwBcjzyU9Y=
808+
github.com/pulumi/pulumi/pkg/v3 v3.178.0 h1:A0IG0OEextrLhVbW9ZpuZU0uILvupJSxWsGjXzeJoeg=
809+
github.com/pulumi/pulumi/pkg/v3 v3.178.0/go.mod h1:RkrGrl/kMr1JYsJlfrKCtCViwhMcwFfrYNTRQw4RamM=
810+
github.com/pulumi/pulumi/sdk/v3 v3.178.0 h1:24jNMvy6cMshwmW88Jm3k8ON2M4d0U2ocemQRcQElXQ=
811+
github.com/pulumi/pulumi/sdk/v3 v3.178.0/go.mod h1:XA+4kQ4ja6b5miOG/l5zp3xdqoA4NoPpmp2SZ37JK40=
810812
github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI=
811813
github.com/pulumi/terraform-diff-reader v0.0.2/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ=
812814
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=

pkg/modprovider/module.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,10 @@ func (h *moduleHandler) initializationError(outputs resource.PropertyMap, reason
299299
contract.AssertNoErrorf(err, "plugin.MarshalProperties failed")
300300

301301
detail := pulumirpc.ErrorResourceInitFailed{
302-
Id: moduleStateResourceID,
303-
Properties: props,
304-
Reasons: reasons,
302+
Id: moduleStateResourceID,
303+
Properties: props,
304+
Reasons: reasons,
305+
RefreshBeforeUpdate: true,
305306
}
306307
return rpcerror.WithDetails(rpcerror.New(codes.Unknown, reasons[0]), &detail)
307308
}

0 commit comments

Comments
 (0)