https://pulumi.com logo
#general
Title
# general
n

numerous-airport-64744

02/20/2024, 3:43 PM
Hi, I'm trying to refactor a provider I build (for k0s) to be based on the latest version of the native provider boilerplate template. But I'm running into an issue with provider parameters. When I try to test the version I end up with the following error:
Copy code
error: pulumi:providers:k0s resource 'myProvider': property noDrain value {true} has a problem: Field 'noDrain' on 'provider.Config' must be a 'bool'; got 'string' instead
Without explicitly configuring it this already happens through the annotation configuration of the configuration struct:
Copy code
a.SetDefault(&c.NoDrain, false, "PULUMI_K0S_NO_DRAIN")
If I remove the defaults from the configuration struct it stops happening. For me it looks like that all parameters are assumed to be strings somewhere internally. If I initialize the provider in the tests through the integration server I don't get the error. You can find the PR here incl. the definition of the provider configuration etc. Anyone any idea why the data types are getting messed up? Let me know if this should go to a specific Slack channel. Thanks, Flo
FYI: I went with using string parameters for now instead of boolean.