Skip to content
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

Fix: Python SDK: kustomize.Directory: handle a not fully configured provider #2347

Conversation

filip-zyzniewski
Copy link
Contributor

Proposed changes

When the kubernetes provider is not fully configured (https://github.com/pulumi/pulumi/blob/v3.60.1/sdk/go/common/resource/plugin/provider_plugin.go#L1364-L1367), then the value property of the InvokeResult instance is None.

This PR attempts to add handling of this case.

Related issues (optional)

Fixes #2346

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@kpitzen
Copy link
Contributor

kpitzen commented Apr 3, 2023

Hi @filip-zyzniewski - thank you so much for your contribution here! It looks like this fix was implemented directly in the Python SDK. Those files are autogenerated from two sources - one is the K8s API spec, and the other is from overlays defined in this repo. If you could re-implement this fix in this file here:
https://github.com/pulumi/pulumi-kubernetes/blob/master/provider/pkg/gen/python-templates/kustomize/kustomize.py
and then run make python_sdk, I think we'll be in a good place to run tests here.
Thanks again!

Per pulumi#2347 (comment)

Result of:

```console
pulumi-kubernetes $ cp sdk/python/pulumi_kubernetes/kustomize/kustomize.py provider/pkg/gen/python-templates/kustomize/kustomize.py
pulumi-kubernetes $ make python_sdk
[...]
pulumi-kubernetes $
```

Fixes: pulumi#2346
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@filip-zyzniewski
Copy link
Contributor Author

If you could re-implement this fix in this file here: https://github.com/pulumi/pulumi-kubernetes/blob/master/provider/pkg/gen/python-templates/kustomize/kustomize.py and then run make python_sdk, I think we'll be in a good place to run tests here.

Hi @kpitzen, thanks, done in f8cf6b3 , PTAL.

@kpitzen
Copy link
Contributor

kpitzen commented Apr 4, 2023

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@kpitzen
Copy link
Contributor

kpitzen commented Apr 4, 2023

Awesome @filip-zyzniewski - this is looking great! One final ask - would you mind adding an entry to CHANGELOG.md under the Unreleased section describing this fix? Tests are passing and it seems like this will accomplish what we'd hope.

Thank you again!

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@filip-zyzniewski
Copy link
Contributor Author

One final ask - would you mind adding an entry to CHANGELOG.md under the Unreleased section describing this fix?

Thanks @kpitzen, done in a136e43, PTAL.

@kpitzen
Copy link
Contributor

kpitzen commented Apr 7, 2023

/run-acceptance-tests

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@pulumi-bot
Copy link
Contributor

@kpitzen
Copy link
Contributor

kpitzen commented Apr 7, 2023

@filip-zyzniewski - the change looks good, all tests are passing, and we have a changelog entry! ✅

Going to get this merged now, and it'll be available in our next release.

@kpitzen kpitzen merged commit a907bdd into pulumi:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pulumi_kubernetes.kustomize.Directory blows up in Python when the cluster does not exist yet
3 participants