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 await status for Job and Pod #2299

Merged
merged 1 commit into from
Feb 6, 2023
Merged

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Feb 1, 2023

Proposed changes

Fix a regression where the intermediate status of Job and Pod resources was no longer printed during an update.

The cloud-ready-checks package changed the way that messages are populated in the state checker. Previously, each condition was returned as a StatusMessage when the Update method was called. During the refactor, the Update method was replaced by the ReadyDetails method, which changed the return type. The updated return type includes a Description and an optional message that was only set when a problem was detected. The regression was caused by failing to print the description if the message was empty. Thus, intermediate status was still printed in case of errors, but was erroneously skipped on the happy path.

This change updates the two usages of this library to iterate the result objects and log each result as a status message. This approximates the previous behavior, and fixes the regression. The cloud-ready-checks package was intended to make this process easier, but the current interface still needs some work, since it shouldn't be necessary for clients to understand this nuance between the Description and Message field.

Related issues (optional)

Fix #2298

@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Does the PR have any schema changes?

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

@squaremo
Copy link
Contributor

squaremo commented Feb 3, 2023

I'd like to see (in the commit message, ideally) an explanation of what was wrong with the way it was done previously (i.e., in #1856), and how this fixes it. It is far from self-evident!

Fix a regression where the intermediate status of Job and Pod resources was no longer printed during an update.

The cloud-ready-checks package changed the way that messages are populated in the state checker. Previously, each condition was returned as a StatusMessage when the Update method was called. During the refactor, the Update method was replaced by the ReadyDetails method, which changed the return type. The updated return type includes a Description and an optional message that was only set when a problem was detected. The regression was caused by failing to print the description if the message was empty. Thus, intermediate status was still printed in case of errors, but was erroneously skipped on the happy path.

This change updates the two usages of this library to iterate the result objects and log each result as a status message. This approximates the previous behavior, and fixes the regression. The cloud-ready-checks package was intended to make this process easier, but the current interface still needs some work, since it shouldn't be necessary for clients to understand this nuance between the Description and Message field.
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Does the PR have any schema changes?

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

Copy link
Contributor

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

The commit message (and PR description) check out -- thanks Levi 💯 So the crucial bit is that checker.Update(...) would construct a status message (https://github.com/pulumi/pulumi-kubernetes/pull/1856/files#diff-cd291f815be7da9f37d3fc13e934cc2781d2316fd473e4e0954f2314a3f6e88eL68) from descriptions; the replacement, checker.ReadyDetails, simply doesn't create those messages. With that in mind, the solution here of printing the descriptions makes sense.

@lblackstone lblackstone merged commit 4324488 into master Feb 6, 2023
@lblackstone lblackstone deleted the lblackstone/await-status-fix branch February 6, 2023 21:24
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.

Job awaiter status regression
2 participants