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

Change validation in Duration type in CRDs and NGF #2525

Merged

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Sep 10, 2024

Proposed changes

Problem: Duration type in crds was limited to being in seconds or milliseconds. This is inconvenient with the keepalive_time nginx directive which defaults to 1 hour.

Solution: Relax the validation to allow for minutes and hours.

Testing: Tested that crds can use minutes and hours for their duration fields.

Closes #2532

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • [] I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Allow minutes and hours units for Duration type in CRDs. This affects ClientSettingsPolicy and NginxProxy CRDs.

@bjee19 bjee19 requested review from a team as code owners September 10, 2024 23:04
@github-actions github-actions bot added documentation Improvements or additions to documentation chore Pull requests for routine tasks labels Sep 10, 2024
@bjee19 bjee19 changed the title Change validation to duration type in crd and NGF Change validation to Duration type in CRDs and NGF Sep 10, 2024
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.34%. Comparing base (605bef5) to head (54d0e29).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2525   +/-   ##
=======================================
  Coverage   89.34%   89.34%           
=======================================
  Files         100      100           
  Lines        7628     7630    +2     
  Branches       50       50           
=======================================
+ Hits         6815     6817    +2     
  Misses        756      756           
  Partials       57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bjee19 bjee19 changed the title Change validation to Duration type in CRDs and NGF Change validation in Duration type in CRDs and NGF Sep 11, 2024
@kate-osborn
Copy link
Contributor

@bjee19 can you update the Release Notes section in the PR description? We will want to release note this.

Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

LGTM once the Release Notes section is updated

@bjee19 bjee19 force-pushed the chore/change-validation-for-crd-duration-type branch 2 times, most recently from 21b7ed0 to 0429c30 Compare September 11, 2024 16:30
@bjee19 bjee19 force-pushed the chore/change-validation-for-crd-duration-type branch from 0429c30 to 54d0e29 Compare September 11, 2024 19:17
@bjee19 bjee19 merged commit 8fb93bb into nginxinc:main Sep 11, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks documentation Improvements or additions to documentation release-notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Relax validation on Duration type in CRDs to include minutes and hours units
5 participants