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: don't validate HTTPRoute for allowedRoutes and listeners in webhook #5469

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

czeslavo
Copy link
Contributor

@czeslavo czeslavo commented Jan 22, 2024

What this PR does / why we need it:

Removes HTTPRoute validations from the admission webhook:

  • HTTPRoute matches Gateway Listener's AllowedRoutes kind,
  • Gateway has a Listener matching an HTTPRoute's protocol,
  • Gateway has a Listener matching an HTTPRoute's section name (NotAllowedByListeners).

All of these validations are already handled in the controller itself:

All of these are now tested as well (on the unit test level):

Which issue this PR fixes:

Fixes #5197.

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@czeslavo czeslavo force-pushed the feat/httproute-ctrl-validation branch from cd74f82 to 8a2ba83 Compare January 22, 2024 17:49
@czeslavo czeslavo self-assigned this Jan 22, 2024
@czeslavo czeslavo added this to the KIC v3.1.x milestone Jan 22, 2024
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (3993e0a) 69.8% compared to head (c31d53a) 69.7%.
Report is 1 commits behind head on main.

Files Patch % Lines
internal/admission/validation/gateway/httproute.go 69.2% 9 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5469     +/-   ##
=======================================
- Coverage   69.8%   69.7%   -0.1%     
=======================================
  Files        176     176             
  Lines      22723   22661     -62     
=======================================
- Hits       15861   15812     -49     
+ Misses      5927    5917     -10     
+ Partials     935     932      -3     

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

@czeslavo czeslavo marked this pull request as ready for review January 22, 2024 17:58
@czeslavo czeslavo requested a review from a team as a code owner January 22, 2024 17:58
@czeslavo czeslavo force-pushed the feat/httproute-ctrl-validation branch from 8a2ba83 to c31d53a Compare January 22, 2024 22:55
Copy link
Contributor

@randmonkey randmonkey left a comment

Choose a reason for hiding this comment

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

Have we added the tests for verifying that the status of HTTPRoute is correctly set in those siturations?

@czeslavo
Copy link
Contributor Author

Have we added the tests for verifying that the status of HTTPRoute is correctly set in those siturations?

Some of them were already there, some were added. I linked to test cases in the PR description.

@czeslavo czeslavo merged commit 939bd85 into main Jan 23, 2024
37 checks passed
@czeslavo czeslavo deleted the feat/httproute-ctrl-validation branch January 23, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove HTTPRoute listener and parentRef validation from admission webhook
2 participants