Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: pulumi:pulumi:getResource no longer returning resource references #11380

Closed
justinvp opened this issue Nov 16, 2022 · 0 comments · Fixed by #11382
Closed

Regression: pulumi:pulumi:getResource no longer returning resource references #11380

justinvp opened this issue Nov 16, 2022 · 0 comments · Fixed by #11382
Assignees
Labels
area/component-packages aka multi-language components area/engine Pulumi engine area/sdks Pulumi language SDKs impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@justinvp
Copy link
Member

justinvp commented Nov 16, 2022

The pulumi:pulumi:getResource builtin is used to get a resource's state, primarily when deserializing a resource reference.

If the resource's state itself contains resource references, we used to always keep those resource references when marshaling the state, but unfortunately this regressed in #9323 back in April: https://github.com/pulumi/pulumi/pull/9323/files#diff-984b3279d61b588030474831898bb76d093d863ca2d0015bb081d842602a9ab7R671

	mret, err := plugin.MarshalProperties(ret, plugin.MarshalOptions{
 		Label:         label,
 		KeepUnknowns:  true,
- 		KeepResources: true,
+ 		KeepResources: req.GetAcceptResources(),

Current implementation:

mret, err := plugin.MarshalProperties(ret, plugin.MarshalOptions{
Label: label,
KeepUnknowns: true,
KeepSecrets: true,
KeepResources: req.GetAcceptResources(),
})

The problem is that none of the language SDKs are setting acceptResources when invoking pulumi:pulumi:getResource, so the returned state no longer contains resource references, but just the ids/urns of the resources (the fallback behavior).

This mostly impacts multi-lang components that have resources in their state that should be "rehydrated" back into associated resource instances when the component itself is rehydrated. This is impacting our EKS component.

We can fix the language SDKs to set acceptResources on the request (and then have EKS depend on the new version of the SDK), but I think we should consider reverting back to the old behavior of always accepting resources, regardless of acceptResources, or perhaps always accepting resources only for pulumi:pulumi:getResource.

@justinvp justinvp added kind/bug Some behavior is incorrect or out of spec area/sdks Pulumi language SDKs area/component-packages aka multi-language components impact/regression Something that used to work, but is now broken area/engine Pulumi engine labels Nov 16, 2022
@justinvp justinvp added this to the 0.81 milestone Nov 16, 2022
@justinvp justinvp self-assigned this Nov 16, 2022
@bors bors bot closed this as completed in b950cf0 Nov 16, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/component-packages aka multi-language components area/engine Pulumi engine area/sdks Pulumi language SDKs impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants