Skip to content

[Slice] Refactor isRelevantWorkload(). #568

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

mbobrovskyi
Copy link
Collaborator

Fixes / Features

  • Refactor isRelevantWorkload().

@mbobrovskyi
Copy link
Collaborator Author

cc: @gabesaba @pajakd

@@ -164,28 +165,23 @@ func (r *WorkloadReconciler) shouldFinalize(wl *kueue.Workload) bool {
return !wl.DeletionTimestamp.IsZero() || workload.IsFinished(wl) || workload.IsEvicted(wl) || !workload.IsActive(wl)
}

func (r *WorkloadReconciler) isRelevantWorkload(wl *kueue.Workload, log logr.Logger) bool {
func isRelevantWorkload(wl *kueue.Workload) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a name which would make more sense given updated return value?

Copy link
Collaborator Author

@mbobrovskyi mbobrovskyi Jul 29, 2025

Choose a reason for hiding this comment

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

Maybe validateRelevantWorkload()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or maybe ensureWorkloadIsRelevant?

@mbobrovskyi mbobrovskyi force-pushed the slice/return-error-instead-of-using-logs branch from 7d3b4d7 to 4ba725d Compare July 29, 2025 14:04
@mbobrovskyi mbobrovskyi requested a review from gabesaba July 29, 2025 15:00
@gabesaba
Copy link
Collaborator

lgtm, thanks!

@gabesaba gabesaba merged commit ddc787f into slice-main Jul 30, 2025
15 of 17 checks passed
@gabesaba gabesaba deleted the slice/return-error-instead-of-using-logs branch July 30, 2025 07:54
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.

2 participants