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

Replacement has incorrect status messages #2761

Closed
EronWright opened this issue Jan 19, 2024 · 0 comments · Fixed by #2810
Closed

Replacement has incorrect status messages #2761

EronWright opened this issue Jan 19, 2024 · 0 comments · Fixed by #2810
Assignees
Labels
area/await-logic kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@EronWright
Copy link
Contributor

EronWright commented Jan 19, 2024

What happened?

I observe that Pulumi emits incorrect status messages when doing a replacement of a Kubernetes resource. In particular, the last message pertaining to the "replacement" object (as it is created) is later shown on the "original" object (as it is deleted).

Example

For example, observe the erroneous "Waiting" messages in the following sequence. Note that I am using --non-interactive for clarity, and that Pulumi is using delete-after-replace semantics in this example.

 ++ kubernetes:core/v1:Pod autonaming-test creating replacement (0s) [diff: ~metadata]
 ++ kubernetes:core/v1:Pod autonaming-test creating replacement (0s) [diff: ~metadata];
 ++ kubernetes:core/v1:Pod autonaming-test creating replacement (0s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be scheduled
 ++ kubernetes:core/v1:Pod autonaming-test creating replacement (0s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be initialized
 ++ kubernetes:core/v1:Pod autonaming-test creating replacement (0s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready
@ updating....
 ++ kubernetes:core/v1:Pod autonaming-test created replacement (1s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready
 +- kubernetes:core/v1:Pod autonaming-test replacing (0s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready
 +- kubernetes:core/v1:Pod autonaming-test replaced (0.00s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready
 -- kubernetes:core/v1:Pod autonaming-test deleting original (0s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready
@ updating.....
 -- kubernetes:core/v1:Pod autonaming-test deleted original (1s) [diff: ~metadata]; Waiting for Pod "test-namespace-4d5e71b3/autonaming-test" to be ready

Output of pulumi about

❯ pulumi about
CLI          
Version      3.94.2
Go Version   go1.21.4
Go Compiler  gc

Host     
OS       darwin
Version  13.5.1
Arch     arm64

Additional context

I believe that the root cause is related to the fact that the "original" object and "replacement" object have the same resource URN. As the CLI emits a log line for each engine event, it repeats the most recent diagnostic message for the associated resource. The "replacement" object's await logic produces the diagnostic messages, but the "original" object doesn't produce any diagnostic message and so the last message of the former object is repeated.

Two fixes come to mind:

  1. Clear the diagnostic message after the await logic completes for a given resource, and/or
  2. Emit a diagnostic message in the await logic for deletions, e.g. "Waiting for finalization..."

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@EronWright EronWright added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 19, 2024
@EronWright EronWright self-assigned this Jan 19, 2024
EronWright added a commit that referenced this issue Feb 2, 2024
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### 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.

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->
Closes #2761
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/await-logic kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants