-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
impact/panicThis bug represents a panic or unexpected crashThis bug represents a panic or unexpected crashkind/bugSome behavior is incorrect or out of specSome behavior is incorrect or out of spec
Description
What happened?
While working with @jdavredbeard on a panicking provider, we discovered that returning a zero value pulumi.StringPtrOutput
on a component would cause the framework to panic.
Example
Attempting to construct this resource will panic:
func provider() (p.Provider, error) {
return infer.NewProviderBuilder().
WithNamespace("examples").
WithComponents(
infer.ComponentF(func(ctx *pulumi.Context, name string, args DemoArgs, opts ...pulumi.ResourceOption) (*Repro, error) {
var comp Repro
err := ctx.RegisterComponentResource(p.GetTypeToken(ctx.Context()), name, &comp, opts...)
if err != nil {
return nil, err
}
comp.NilOutputString = pulumi.StringPtrOutput{}
return &comp, nil
}),
).
Build()
}
type DemoArgs struct{}
type Repro struct {
pulumi.ResourceState
NilOutputString pulumi.StringPtrOutput `pulumi:"s,optional"`
}
Output of pulumi about
v3.173.0
Additional context
6fad605 is a working reproduction. You can see the panic by checkout out 6fad605 and then running make examples/component-provider/test
.
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
EronWright
Metadata
Metadata
Assignees
Labels
impact/panicThis bug represents a panic or unexpected crashThis bug represents a panic or unexpected crashkind/bugSome behavior is incorrect or out of specSome behavior is incorrect or out of spec