-
Notifications
You must be signed in to change notification settings - Fork 113
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: Make the invoke calls for Helm charts and YAML config resilient to the value being None
or an empty dict
#2665
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is based on the existing `helm-local` test.
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2665 +/- ##
=======================================
Coverage 18.31% 18.31%
=======================================
Files 47 47
Lines 9644 9644
=======================================
Hits 1766 1766
Misses 7779 7779
Partials 99 99 ☔ View full report in Codecov by Sentry. |
This is based on the existing `yaml-test` test.
The invoke used for Kustomize was already fixed to be resilient to `None` or empty dicts being returned in a907bdd. This test, which is based on the existing `kustomize` test is to ensure it continues to work without an error being raised.
Make the hand-rolled invoke code resilient to `invoke` returning either `None` or an empty dict for empty results. This aligns all invokes with the same pattern as introduced by a907bdd.
7a7ba32
to
55f0e8f
Compare
rquitales
approved these changes
Nov 13, 2023
EronWright
approved these changes
Nov 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: The changes are broken up into multiple commits for easier review.
Proposed changes
In v3.92.0 of the core
pulumi
Python SDK, invokes were changed to return an empty dict rather thanNone
for empty results, which is consistent with other language SDKs and the original behavior of the Python SDK, and makes generated provider Python SDKs work with empty results. However, the hand-rolled invoke code in the Kubernetes Python SDK for Helm and YAML are not resilient to it getting an empty dict. This change fixes Helm and YAML to be resilient, in the same way that the invoke for Kustomize was updated in a907bdd.An invoke will return empty results when called on an unconfigured provider (i.e. a provider whose configuration contains an unknown value). The first three commits add regression tests that pass an unknown value as a provider's configuration. The Helm and YAML regression tests fail before the fix and succeed after the fix. The test for Kustomize already succeeds because of the change in a907bdd. The new tests are based on existing tests.
To ensure older versions of
pulumi-kubernetes
continue to work with newer versions ofpulumi
, we're planning to patch thepulumi
SDK to returnNone
for empty invoke returns when the function is one of the affected kubernetes function tokens. This is tracked by pulumi/pulumi#14508 (PR: pulumi/pulumi#14535).Related issues
Fixes #2664