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

Add delete predicate for gateway class #1696

Merged
merged 6 commits into from
Apr 2, 2024

Conversation

hckuo
Copy link
Contributor

@hckuo hckuo commented Mar 15, 2024

Proposed changes

This PR adds a delete predicate to the gateway class checking if the controller name matches the predicate name.

Problem:
Solve the issue of #1476 where reconciler should not delete the gateway resource if the name does not match.

Solution:
Add a delete predicate to the gateway class checking if the controller name matches the predicate name.

Testing:
This PR is unit-tested.

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.

Closes #1476

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.


@hckuo hckuo requested a review from a team as a code owner March 15, 2024 00:55
Copy link

nginx-bot bot commented Mar 15, 2024

Hi @hckuo! Welcome to the project! 🎉

Thanks for opening this pull request!
Be sure to check out our Contributing Guidelines while you wait for someone on the team to review this.

@nginx-bot nginx-bot bot added the community label Mar 15, 2024
@hckuo hckuo marked this pull request as draft March 15, 2024 00:55
@hckuo hckuo changed the title add predicate [WIP] add predicate Mar 15, 2024
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.

@hckuo thanks for working on this, it looks good!

I manually verified that the delete events for GatewayClasses with a different controller name are filtered out by the predicate.

Can you update the PR description and fill out the template? Thanks!

@hckuo hckuo requested a review from kate-osborn March 17, 2024 02:39
@hckuo hckuo marked this pull request as ready for review March 17, 2024 02:39
@mpstefan mpstefan added this to the v1.3.0 milestone Mar 20, 2024
@hckuo hckuo requested a review from kate-osborn March 30, 2024 02:25
@hckuo hckuo changed the title [WIP] add predicate Add delete predicate for gateway class Mar 30, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.18%. Comparing base (03e24fe) to head (120536a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1696      +/-   ##
==========================================
+ Coverage   86.16%   86.18%   +0.01%     
==========================================
  Files          87       87              
  Lines        5515     5522       +7     
  Branches       52       52              
==========================================
+ Hits         4752     4759       +7     
  Misses        717      717              
  Partials       46       46              

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

Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

lgtm!

@kate-osborn kate-osborn merged commit 4faad66 into nginxinc:main Apr 2, 2024
40 checks passed
amimimor pushed a commit to amimimor/nginx-gateway-fabric that referenced this pull request Apr 3, 2024
Problem: The controller reconciles delete events for 
GatewayClasses that are not owned by NGF.

Solution: Add a delete function to the GatewayClass 
predicate that ignores delete events for GatewayClasses
with the wrong controller name.
@lucacome lucacome added the tech-debt Short-term pain, long-term benefit label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community tech-debt Short-term pain, long-term benefit
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Don't reconcile delete events for GatewayClasses that do not reference NGF
7 participants