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

[dotnet] Unknowns for previews involving an uninitialized provider #2957

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Apr 17, 2024

Proposed changes

This PR fixes the "panic" that occurs when an uninitialized provider is used with the yaml/kustomize resources. In that situation, the invoke calls aren't performed and the engine simply returns an uninitialized result. This causes a problem in the callers because the methods on ImmutableArray mustn't be used when the value is uninitialized (i.e. when IsDefault is true).

Example

The example given in #2741 easily repros the issue. With this fix, the behavior improves:

Diagnostics:
  kubernetes:yaml:ConfigFile (guestbook):
    warning: Required input properties have unknown values. Preview is incomplete.

Outputs:
    FrontendIp: output<string>

Testing

Includes integration tests involving an uninitialized provider with a ConfigFile or Directory.

Related issues (optional)

Closes #2741

Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.18%. Comparing base (ee61f79) to head (7e15162).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2957   +/-   ##
=======================================
  Coverage   29.18%   29.18%           
=======================================
  Files          61       61           
  Lines        8196     8196           
=======================================
  Hits         2392     2392           
  Misses       5600     5600           
  Partials      204      204           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix and regression test LGTM!

It's worth updating the changelog since this is user-facing.

@EronWright EronWright enabled auto-merge (squash) April 17, 2024 16:48
@EronWright EronWright enabled auto-merge (squash) April 17, 2024 16:49
@EronWright EronWright merged commit 6eb4495 into master Apr 17, 2024
18 checks passed
@EronWright EronWright deleted the eronwright/issue-2741 branch April 17, 2024 17:18
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Apr 19, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@pulumi/kubernetes](https://pulumi.com)
([source](https://togithub.com/pulumi/pulumi-kubernetes)) | dependencies
| minor | [`4.10.0` ->
`4.11.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.10.0/4.11.0)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>pulumi/pulumi-kubernetes (@&#8203;pulumi/kubernetes)</summary>

###
[`v4.11.0`](https://togithub.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#4110-April-17-2024)

[Compare
Source](https://togithub.com/pulumi/pulumi-kubernetes/compare/v4.10.0...v4.11.0)

- \[dotnet] Unknowns for previews involving an uninitialized provider
[https://github.com/pulumi/pulumi-kubernetes/pull/2957](https://togithub.com/pulumi/pulumi-kubernetes/pull/2957)7)
- Update Kubernetes schemas and libraries to v1.30.0
([https://github.com/pulumi/pulumi-kubernetes/pull/2932](https://togithub.com/pulumi/pulumi-kubernetes/pull/2932))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMDMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMwMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dotnet] pulumi preview fails when giving a Provider with unknowns to a ConfigGroup
2 participants