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(KongPlugin): generate K8s Events for missing grant #6841

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

programmer04
Copy link
Member

@programmer04 programmer04 commented Dec 16, 2024

What this PR does / why we need it:

The previous PR

mentioned

There are still logs that should be events and statuses related to plugins like in this helper for cross-namespace access, but it can be handled in a separate PR or issue.

this PR adresses it, now there is no error log in such situation and respective K8s Event is generated

default     4m8s        Warning   KongConfigurationTranslationFailed   httproute/httproute-testing-2        no grant found to referenced "third:fourth" plugin in the requested remote KongPlugin bind

for httproute/httproute-testing-2 that has annotation konghq.com/plugins that contains non-existent third:fourth.

Which issue this PR fixes:

Together with a dedicated (leftover mentioned in PR #6814) issue #6842 this PR closes #6540

Special notes for your reviewer:

Besides adjustment of the returned error function, isRemotePluginReferenceAllowed is moved closer to it actual and single usage to make the code easier to follow.

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

@programmer04 programmer04 added this to the KIC v3.4.x milestone Dec 16, 2024
@programmer04 programmer04 self-assigned this Dec 16, 2024
@programmer04 programmer04 marked this pull request as ready for review December 16, 2024 11:13
@programmer04 programmer04 requested a review from a team as a code owner December 16, 2024 11:13
@programmer04 programmer04 enabled auto-merge (squash) December 16, 2024 11:13
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 81.33333% with 14 lines in your changes missing coverage. Please review.

Project coverage is 77.0%. Comparing base (425d3ef) to head (1f4d4e6).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/dataplane/kongstate/kongstate.go 83.8% 9 Missing and 2 partials ⚠️
internal/gatewayapi/contraints.go 40.0% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #6841     +/-   ##
=======================================
- Coverage   77.1%   77.0%   -0.2%     
=======================================
  Files        210     211      +1     
  Lines      25281   25295     +14     
=======================================
- Hits       19508   19489     -19     
- Misses      4762    4791     +29     
- Partials    1011    1015      +4     

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

@programmer04 programmer04 merged commit 3cf39d2 into main Dec 16, 2024
39 checks passed
@programmer04 programmer04 deleted the events-plugin-grant branch December 16, 2024 13:17
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.

Missing resource results in huge error log volume "not found"
2 participants