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

Improve logging of workload status #2062

Merged

Conversation

mimowo
Copy link
Contributor

@mimowo mimowo commented Apr 25, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Currently, the log messages suggest that the workload is admitted, only if it has quota reserved.
This is confusing when debugging issues related to admission checks.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Correctly log workload status for workloads with quota reserved, but awaiting for admission checks.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Apr 25, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 25, 2024
@mimowo
Copy link
Contributor Author

mimowo commented Apr 25, 2024

/assign @tenzen-y @alculquicondor

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 25, 2024
Copy link

netlify bot commented Apr 25, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 60b4674
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/662a10c9f959b300092c1c70
😎 Deploy Preview https://deploy-preview-2062--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -660,9 +661,12 @@ func workloadStatus(w *kueue.Workload) string {
if apimeta.IsStatusConditionTrue(w.Status.Conditions, kueue.WorkloadFinished) {
return finished
}
if workload.HasQuotaReservation(w) {
if workload.IsAdmitted(w) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we really need this distinction? Can we just track quotaReserved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was thinking about it, and chose this approach because:

  1. just renaming to quotaReserved would mean we still have misleading logs, but the other way round
  2. having more granular status might be helpful, for example here we only need to enter for admitted

I guess if we have too many occurences of (quotaReserved || admitted) then we could wrap them with quotaReservedOrAdmitted helper function.

@alculquicondor
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c934797e4eef381f19a2cdd7e80503da19e82b27

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, mimowo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 3d764d5 into kubernetes-sigs:main Apr 25, 2024
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.7 milestone Apr 25, 2024
@mimowo
Copy link
Contributor Author

mimowo commented Apr 26, 2024

@alculquicondor @tenzen-y should we cherry-pick this?

On one hand this is just logs, but OTOH it could be helpful to investigate workloads using ProvReq on 0.6.3. WDYT?

@tenzen-y
Copy link
Member

@alculquicondor @tenzen-y should we cherry-pick this?

On one hand this is just logs, but OTOH it could be helpful to investigate workloads using ProvReq on 0.6.3. WDYT?

Considering this conflict (#2061 (comment)), I'd like to vote to cherry pick this PR.

@alculquicondor
Copy link
Contributor

sgtm

@mimowo
Copy link
Contributor Author

mimowo commented Apr 26, 2024

/cherry-pick release-0.6

@k8s-infra-cherrypick-robot

@mimowo: new pull request created: #2080

In response to this:

/cherry-pick release-0.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants