-
Notifications
You must be signed in to change notification settings - Fork 115
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
Resource undergoing replacement has incorrect status messages #2810
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2810 +/- ##
=======================================
Coverage 24.72% 24.72%
=======================================
Files 48 48
Lines 9647 9651 +4
=======================================
+ Hits 2385 2386 +1
- Misses 7106 7109 +3
Partials 156 156 ☔ View full report in Codecov by Sentry. |
@@ -276,6 +276,7 @@ func Creation(c CreateConfig) (*unstructured.Unstructured, error) { | |||
if waitErr != nil { | |||
return nil, waitErr | |||
} | |||
_ = clearStatus(c.Context, c.Host, c.URN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: what I've seen at Pulumi before for intentionally ignoring errors is:
err := clearStatus(...)
contract.IgnoreError(err)
@@ -773,6 +776,10 @@ func Deletion(c DeleteConfig) error { | |||
}, | |||
clientForResource: client, | |||
}) | |||
if waitErr != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one bit here (and associated return) where it's not immediately obvious to a tired reader that control flow is not changing, and this is just a logging change, however I think that's still the case, it's not changing, localizing error handling to make the code better.. Appreciate eyes on this :)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/kubernetes](https://pulumi.com) ([source](https://github.com/pulumi/pulumi-kubernetes)) | dependencies | minor | [`4.7.1` -> `4.8.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.7.1/4.8.0) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>pulumi/pulumi-kubernetes (@​pulumi/kubernetes)</summary> ### [`v4.8.0`](https://github.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#480-February-22-2024) [Compare Source](https://github.com/pulumi/pulumi-kubernetes/compare/v4.7.1...v4.8.0) - Fix DiffConfig issue when when provider's kubeconfig is set to file path ([https://github.com/pulumi/pulumi-kubernetes/pull/2771](https://github.com/pulumi/pulumi-kubernetes/pull/2771)) - Fix for replacement having incorrect status messages ([https://github.com/pulumi/pulumi-kubernetes/pull/2810](https://github.com/pulumi/pulumi-kubernetes/pull/2810)) - Use output properties for await logic ([https://github.com/pulumi/pulumi-kubernetes/pull/2790](https://github.com/pulumi/pulumi-kubernetes/pull/2790)) - Support for metadata.generateName (CSA) ([https://github.com/pulumi/pulumi-kubernetes/pull/2808](https://github.com/pulumi/pulumi-kubernetes/pull/2808)) - Fix unmarshalling of Helm values yaml file ([https://github.com/pulumi/pulumi-kubernetes/issues/2815](https://github.com/pulumi/pulumi-kubernetes/issues/2815)) - Handle unknowns in Helm Release resource ([https://github.com/pulumi/pulumi-kubernetes/pull/2822](https://github.com/pulumi/pulumi-kubernetes/pull/2822)) </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://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMTAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIxMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Proposed changes
This PR clears the resource status after the awaiter completes, to ensure that the status pertaining to a replacement resource (which would have the same URN) isn't stale.
In this example, the status message is obsolete once the flow hits "created replacement". Before:
After:
Related issues (optional)
Closes #2761