-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allow specifying dependencies for output invokes #693
Conversation
a0e5006
to
caf1dd9
Compare
caf1dd9
to
c07a146
Compare
pkg/pulumiyaml/run.go
Outdated
if err != nil { | ||
return e.error(t, err.Error()) | ||
} | ||
|
||
if t.Return.GetValue() == "" { | ||
output := pulumi.OutputWithDependencies(context.TODO(), pulumi.Any(result), deps...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.pulumiCtx
has a .Context()
which might be a good thing to hang this off, rather than TODO
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, there's another call to context.TODO just above in the call to ResolveFunction
, I'll update that one too.
pkg/pulumiyaml/run.go
Outdated
} | ||
|
||
retv, ok := result[t.Return.Value] | ||
if !ok { | ||
e.error(t.Return, fmt.Sprintf("Unable to evaluate result[%v], result is: %+v", t.Return.Value, t.Return)) | ||
return e.error(t.Return, fmt.Sprintf("fn::invoke of %s did not contain a property '%s' in the returned value", t.Token.Value, t.Return.Value)) | ||
} | ||
|
||
output := pulumi.OutputWithDependencies(context.TODO(), pulumi.Any(retv), deps...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thoughts about context.TODO
here.
@@ -216,7 +216,7 @@ runtime: yaml | |||
requireNoErrors(t, tmpl, diags) | |||
} | |||
|
|||
func TestInvokeReturningSecrets(t *testing.T) { | |||
func TestInvokeReturningSecretsWithReturn(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best name change? I'm guessing one is testing plain, the other outputs? Or is it something different? It's not super clear to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's not super clear. This test has a return
property on the invoke on like 229, so the test covers the if t.Return.GetValue() == "" {
branch above, whereas the other test returns the whole response, covering the rest of the changes in that file.
64c7865
to
3c287a0
Compare
go.mod
Outdated
github.com/pulumi/pulumi/pkg/v3 v3.142.1-0.20241210130857-42257d81376e | ||
github.com/pulumi/pulumi/sdk/v3 v3.142.1-0.20241210130857-42257d81376e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO @julienp update on next pu/pu release
f0ccee2
to
769eea4
Compare
4ff4373
to
8120bac
Compare
1079e69
to
737c489
Compare
## v1.13.0 - 2024-12-17 ### Improvements - [runtime] Allow specifying dependencies for output invokes [#693](#693) - [runtime] Update to pulumi v3.143.0 [#700](#700) ### Bug Fixes - [runtime] Fix the language plugin to return a version [#682](#682) - [runtime] Fix a mixup between package names and plugin names when listing required plugins [#688](#688) - [runtime] Resource properties marked as secret in schema are now sent as secrets [#698](#698) - [convert] Emit invoke options to PCL when ejecting YAML templates [#697](#697)
This PR has been shipped in release v1.13.0. |
Provider functions that take inputs as arguments, and return an output (aka output invokes), now allow specifying a
dependsOn
option. This allows programs to ensure that invokes are executed after things they depend on, similar to thedepdendsOn
resource option.pulumi/pulumi#17710
Fixes pulumi/pulumi#17755