You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to create the schema for the random-login provider with this patch:
examples/random-login/main.go | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/examples/random-login/main.go b/examples/random-login/main.go
index b3b0ba8..7e406fe 100644
--- a/examples/random-login/main.go+++ b/examples/random-login/main.go@@ -41,7 +41,8 @@ func provider() p.Provider {
// like this structure is only implementable in typescript, but that will need to change.
type MoreRandomPassword struct{}
type MoreRandomPasswordArgs struct {
- Length *random.RandomInteger `pulumi:"length" provider:"[email protected]:index/randomInteger:RandomInteger"`+ Length *random.RandomInteger `pulumi:"length" provider:"[email protected]:index/randomInteger:RandomInteger"`+ PasswordArgs *random.RandomPasswordArgs `pulumi:"pArgs,optional"`
}
type MoreRandomPasswordState struct {
@@ -59,9 +60,11 @@ func (r *MoreRandomPassword) Construct(ctx *pulumi.Context, name, typ string, ar
return nil, err
}
- pArgs := &random.RandomPasswordArgs{- Length: args.Length.Result,+ pArgs := args.PasswordArgs+ if pArgs == nil {+ pArgs = new(random.RandomPasswordArgs)
}
+ pArgs.Length = args.Length.Result
pctx := infer.CtxFromPulumiContext(ctx)
config := infer.GetConfig[Config](pctx)
When I called GetSchema on the provider, I got:
--- FAIL: TestSchema (0.00s)
main_test.go:137:
Error Trace: /Users/ianwahbe/go/src/github.com/pulumi/pulumi-go-provider/examples/random-login/main_test.go:137
Error: Received unexpected error:
1 error occurred:
* failed to get schema for 'random-login:index:MoreRandomPassword': 1 error occurred:
* could not serialize input type main.MoreRandomPasswordArgs: invalid type 'random.RandomPasswordArgs' on 'main.MoreRandomPasswordArgs.PasswordArgs': RandomPasswordArgs is an input type, but does not have a ToRandomPasswordArgsOutput method
Expected Behavior
I expect this type to be registered into the schema of random-login. I want this type to be injected into the schema instead of referenced because *Args types are not in the pulumi schema.
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).
The text was updated successfully, but these errors were encountered:
What happened?
I tried to create the schema for the
random-login
provider with this patch:When I called
GetSchema
on the provider, I got:Expected Behavior
I expect this type to be registered into the schema of
random-login
. I want this type to be injected into the schema instead of referenced because *Args types are not in the pulumi schema.Steps to reproduce
See example from commit 6034a2c.
Output of
pulumi about
NA
Additional context
No response
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).
The text was updated successfully, but these errors were encountered: