Hey all! Anyone know if there’s a way to refresh t...
# typescript
l
Hey all! Anyone know if there’s a way to refresh the provider state for typescript custom providers?
l
By provider state, do you mean the cloud resources, or the configuration of the provider object? What isn't working the way you'd like it to?
l
More specifically dynamic resource providers. Currently looking into an issue where the v1 of the dynamic resource provider had a bug in the diff logic. There’s a fix in v2 but not too sure how to bring this into the state
I guess I could manually replace the transpiled javascript in the state itself - but that feels a bit icky 👀
l
And the dynamic provider is in a different codebase? Once the right code is being called by Pulumi, that's all you should need. So if it's in a different codebase / package, you'll need to update your packages.json. If it's in the same codebase, it should "just work".
l
Yup - it’s in the same code base. I don’t think refresh/preview/diff uses the “current” dynamic provider. Instead, it uses the dynamic provider at the point of the last
up
l
Oh. I haven't encountered that problem. Since the logic isn't in the state file, it seems odd. I think you'll need help from a staff member for that one, it might be pretty involved 😞
Maybe chuck in a few
pulumi.log()
statements into the diff code and verify that they're not being used?
Then raise a GitHub issue in pulumi/pulumi.
l
Good idea! Yeah, i think it might be typescript specific since i can see the transpiled javascript in the
__provider
property in the state. Anyways, I’ll do some more digging! Thanks for your help!
l
Ah, then you're a step or two ahead of me already! Good luck!