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

feat: introduce configurable TTLSecondsAfterFinished for tasks #2404

Merged

Conversation

prakrit55
Copy link
Member

Description

  • added TTLSecondsAfterFinished

Fixes #2252

How to test

Please describe how to run the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also provide information about any automatic tests that you added.

  • Manual Test A
  • Unit Test B
  • Integration Test C

Checklist

  • My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
    into multiple PRs)
  • I used descriptive commit messages to help reviewers understand my thought process
  • I signed off all my commits according to the Developer Certificate of Origin (DCO)
    see Contribution Guide
  • My PR title is formatted according to the semantic PR conventions described in
    the Contribution Guide
  • My code follows the style guidelines of this project (golangci-lint passes, YAMLLint passes)
  • I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation (if needed)
  • My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)
  • New and existing unit and integration tests pass locally with my changes

Summary

This allows the user to clean up jobs after it has failed or completed after a specified time( held by user in TaskDefinition).

Fixes #2252

Checks

  • My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
    into multiple PRs)
  • I used descriptive commit messages to help reviewers understand my thought process
  • I signed off all my commits according to the Developer Certificate of Origin (DCO)(
    see Contribution Guide)
  • My PR title is formatted according to the semantic PR conventions described in
    the Contribution Guide
  • My content follows the style guidelines of this project (YAMLLint, markdown-lint)
  • I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
  • I have performed a self-review of my content including grammar and typo errors and also checked the rendered page
    from the Netlify deploy preview
  • My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)

Signed-off-by: Griffin <prakritimandal611@gmail.com>
@prakrit55 prakrit55 requested review from a team as code owners November 3, 2023 04:22
@github-actions github-actions bot added documentation Improvements or additions to documentation lifecycle-operator labels Nov 3, 2023
Copy link

netlify bot commented Nov 3, 2023

Deploy Preview for keptn-lifecycle-toolkit ready!

Name Link
🔨 Latest commit ea69cd0
🔍 Latest deploy log https://app.netlify.com/sites/keptn-lifecycle-toolkit/deploys/654475871a779300087adc6d
😎 Deploy Preview https://deploy-preview-2404--keptn-lifecycle-toolkit.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.

@prakrit55
Copy link
Member Author

hey @RealAnna, @odubajDT, @mowies, if its alright and the implementation is correct, I am going to push the tests next

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #2404 (4a2c3da) into main (e7db66f) will increase coverage by 0.25%.
Report is 30 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2404      +/-   ##
==========================================
+ Coverage   85.50%   85.75%   +0.25%     
==========================================
  Files         161      161              
  Lines       10166    10202      +36     
==========================================
+ Hits         8692     8749      +57     
+ Misses       1196     1183      -13     
+ Partials      278      270       -8     
Files Coverage Δ
...is/lifecycle/v1alpha3/keptntaskdefinition_types.go 75.00% <ø> (ø)
...rator/controllers/lifecycle/keptntask/job_utils.go 65.54% <100.00%> (+0.29%) ⬆️

... and 24 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 67.43% <ø> (ø)
component-tests 57.20% <100.00%> (+0.78%) ⬆️
lifecycle-operator 85.44% <100.00%> (-0.26%) ⬇️
metrics-operator 87.58% <ø> (ø)
scheduler 32.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@thisthat thisthat left a comment

Choose a reason for hiding this comment

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

Thanks @prakrit55 for the PR. I left some comments to simplify the implementation moving the logic of handling a default value to K8s instead of dealing with it ourselves :)

lifecycle-operator/chart/templates/deployment.yaml Outdated Show resolved Hide resolved
lifecycle-operator/chart/values.yaml Outdated Show resolved Hide resolved
lifecycle-operator/config/manager/manager.yaml Outdated Show resolved Hide resolved
Signed-off-by: Griffin <prakritimandal611@gmail.com>
@prakrit55
Copy link
Member Author

hey @thisthat, you can have a look now, I have applied the changes

Signed-off-by: Griffin <prakritimandal611@gmail.com>
Signed-off-by: Griffin <prakritimandal611@gmail.com>
Copy link

sonarcloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thisthat
Copy link
Member

thisthat commented Nov 9, 2023

LGTM :shipit: Thanks for the help @prakrit55 🙌

Copy link
Contributor

@odubajDT odubajDT left a comment

Choose a reason for hiding this comment

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

Thank you for contribution!

@prakrit55
Copy link
Member Author

Thanks, you guys too for helping me out .😊

@odubajDT odubajDT merged commit 8341dbf into keptn:main Nov 9, 2023
47 of 48 checks passed
@prakrit55 prakrit55 deleted the feature/ttlsecondsafterfinished-in-job branch November 30, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation lifecycle-operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce configurable TTLSecondsAfterFinished for tasks
3 participants