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: add defaulter for gateway-api resources loading from file #5232

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

shawnh2
Copy link
Contributor

@shawnh2 shawnh2 commented Feb 8, 2025

What type of PR is this?

What this PR does / why we need it:

  • add defaulter for our crd resources, allow them to set default values while loading from file
    • the defaulter code is derived from kubectl-validate's validator, cannot reuse their logic since some of their functions/fields are not exposed
  • fix the existing test and add new test for loading supported kind resources

Which issue(s) this PR fixes:

Fixes #4858

Release Notes: Yes

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 61.68831% with 59 lines in your changes missing coverage. Please review.

Project coverage is 68.01%. Comparing base (4f01d3f) to head (9eae27e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/resource/defaulter.go 62.16% 42 Missing and 14 partials ⚠️
internal/gatewayapi/resource/load.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5232      +/-   ##
==========================================
+ Coverage   66.91%   68.01%   +1.10%     
==========================================
  Files         211      212       +1     
  Lines       33176    33328     +152     
==========================================
+ Hits        22199    22669     +470     
+ Misses       9628     9290     -338     
- Partials     1349     1369      +20     

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

@shawnh2 shawnh2 changed the title feat: add defaulter for standalone feat: add defaulter for gateway-api resources loading from file Feb 8, 2025
…ting tests

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
@shawnh2 shawnh2 marked this pull request as ready for review February 9, 2025 06:23
@shawnh2 shawnh2 requested a review from a team as a code owner February 9, 2025 06:23
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !
neat way to default :)

@arkodg arkodg requested review from a team February 10, 2025 22:24
@shawnh2
Copy link
Contributor Author

shawnh2 commented Feb 11, 2025

/retest

@shawnh2 shawnh2 merged commit 7146fe8 into envoyproxy:main Feb 12, 2025
25 checks passed
@shawnh2 shawnh2 deleted the default-standalone branch February 12, 2025 12:58
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.

Panic when adding healthcheck to gateway in standalone mode
4 participants