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

Adding functionality to delete successfully completed jobs in a FIFO … #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sbdtu5498
Copy link
Contributor

Ⅰ. Describe what this PR does

This PR adds functionality to delete successfully completed jobs based on the given history limits in a FIFO manner in the cron controller.

II. Does this pull request fix one issue?

fixed #244.

III. Special notes for reviewers if any.

Note that in this PR failed jobs are not considered while deleting completed jobs so that they can be manually diagnosed by the individual, as per good practice. But if required or if the reviewers consider it to be more beneficial appropriate changes can be made.

@sbdtu5498
Copy link
Contributor Author

cc: @SimonCqk

@sbdtu5498
Copy link
Contributor Author

@SimonCqk would it be a good idea to strip deleted workloads from CronHistory as well.

…fashion based on the given history limits in a cron controller

Signed-off-by: Sanskar Bhushan <[email protected]>
@sbdtu5498 sbdtu5498 force-pushed the add-deleting-successfully-completed-jobs-based-on-history-limits branch from 7e083bf to 0c306c6 Compare April 25, 2023 21:32
@sbdtu5498
Copy link
Contributor Author

@SimonCqk please review.


// Register the required Kubernetes API types with the Scheme object.
corev1.AddToScheme(s)
v1alpha1.AddToScheme(s)
Copy link
Collaborator

Choose a reason for hiding this comment

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

scheme created here can be a static one and being reused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it

@SimonCqk
Copy link
Collaborator

SimonCqk commented May 5, 2023

@SimonCqk please review.

nice work!

@SimonCqk
Copy link
Collaborator

SimonCqk commented May 5, 2023

@sbdtu5498 LGTM in my view, anyway, can you add some unit tests for this feature?

@sbdtu5498
Copy link
Contributor Author

sbdtu5498 commented May 6, 2023

Sure thing! Also, do you think it would be a good idea to have two different historyLimit e.g. successfulHistoryLimit and failedHistoryLimit, to give more freedom to users over which jobs to delete as this function hereby considers only successful jobs while implementing historyLimit?

@SimonCqk
Copy link
Collaborator

SimonCqk commented May 9, 2023

Sure thing! Also, do you think it would be a good idea to have two different historyLimit e.g. successfulHistoryLimit and failedHistoryLimit, to give more freedom to users over which jobs to delete as this function hereby considers only successful jobs while implementing historyLimit?

sounds like a nice-to-have feature, since it introduces api changes, can you implement it in another PR and merge this commit first?

@sbdtu5498
Copy link
Contributor Author

Sure!

@SimonCqk
Copy link
Collaborator

SimonCqk commented Dec 6, 2023

@sbdtu5498 hi, it seems that UT/e2e checks failed, would you rebase upstream master branch and add more tests, then the PR can move on!!

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.

[feature request] Delete the completed tfjob created by cron when tfjob number reach historyLimit
2 participants