Skip to content

cleanup: add workload Evict and Finish Clock and RoleTracker options#9701

Open
mykysha wants to merge 2 commits intokubernetes-sigs:mainfrom
epam:feat/options-workload-evict-finish
Open

cleanup: add workload Evict and Finish Clock and RoleTracker options#9701
mykysha wants to merge 2 commits intokubernetes-sigs:mainfrom
epam:feat/options-workload-evict-finish

Conversation

@mykysha
Copy link
Contributor

@mykysha mykysha commented Mar 6, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Add Clock and RoleTracker options to Evict and Finish workload functions. Options can be reused afterwards to extend these functions

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Prerequisite for #9371

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 6, 2026
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 9af0a7e
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kueue/deploys/69aedcabdec4920008ba29be

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mykysha
Once this PR has been reviewed and has the lgtm label, please assign tenzen-y for approval. For more information see the Code Review Process.

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

Details 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 added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 6, 2026
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 6, 2026
// finish workload and copy the status to the local one
return reconcile.Result{}, workload.Finish(ctx, w.client, group.local, remoteFinishedCond.Reason, remoteFinishedCond.Message, w.clock, w.roleTracker)
return reconcile.Result{}, workload.Finish(ctx, w.client, group.local, remoteFinishedCond.Reason, remoteFinishedCond.Message,
workload.FinishWithClock(w.clock), workload.FinishWithRoleTracker(w.roleTracker))
Copy link
Contributor

@mimowo mimowo Mar 6, 2026

Choose a reason for hiding this comment

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

the option names have the reduntand part 'Finish'. It was a problem before but with extra Params it looks even more weird. I'm wondering we could move the options and the helper Finish function to a subpackage like workload/finish. Analogously for evict. The common code could be moved to subpackage like workload/patching, WDYT? cc @mbobrovskyi . I think it is better to do now than grow the number of weird option functions.

@mykysha mykysha force-pushed the feat/options-workload-evict-finish branch from f7d83e9 to 7884acc Compare March 9, 2026 14:35
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 9, 2026
@mykysha mykysha force-pushed the feat/options-workload-evict-finish branch from 7884acc to 9af0a7e Compare March 9, 2026 14:43
@mimowo
Copy link
Contributor

mimowo commented Mar 9, 2026

Hm, I don't undrstand, why the PR title suggests feature by the "feat" prefix: "feat: add workload Evict and Finish Clock and RoleTracker options". Otoh, there is no release note. So, I'm not sure if there is any user-observable change, or just refactoring? Or maybe this is a bug, because RoleTracker was not added before?

@mykysha mykysha changed the title feat: add workload Evict and Finish Clock and RoleTracker options cleanup: add workload Evict and Finish Clock and RoleTracker options Mar 9, 2026
@mimowo
Copy link
Contributor

mimowo commented Mar 9, 2026

Ah, I see this is cleanup. Thank you for updating. I'm now wondering if we need to pump the options via Finish and Evict functions. Maybe we could instead increment the finished metric in the workload_controller Update event, when we notice prevStatus != Finished, status=Finished - transition. wdyt @mbobrovskyi @mykysha ?

@mykysha
Copy link
Contributor Author

mykysha commented Mar 9, 2026

I think it might work, let me take a closer look. It would definitely simplify the process if we would not need to pass the config to Evict and Finish

@mimowo
Copy link
Contributor

mimowo commented Mar 9, 2026

/hold
Cool, please evaluate the approach in a separate PR so that we could compare. That could also be a prep - just to refactor for now.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants