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: propagate translation failures for KongPlugin and KongClusterPlugin #4428

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

czeslavo
Copy link
Contributor

@czeslavo czeslavo commented Jul 28, 2023

What this PR does / why we need it:

Instead of just logging an error in case of an invalid KongPlugin or KongClusterPlugin's configuration, bubble up the translation failure so that the Programmed condition is populated with False and reason Invalid and an event is emitted.

Also drops unnecessary validation of plugin.PluginName which is handled on the Kubernetes API level thanks to the CRD validation (KongPlugin, KongClusterPlugin).

Which issue this PR fixes:

Noticed when working on #3344.

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 added the area/feature New feature or request label Jul 28, 2023
@czeslavo czeslavo added this to the KIC v2.11.0 milestone Jul 28, 2023
@czeslavo czeslavo self-assigned this Jul 28, 2023
@czeslavo czeslavo marked this pull request as ready for review July 28, 2023 22:41
@czeslavo czeslavo requested a review from a team as a code owner July 28, 2023 22:41
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Patch coverage: 75.0% and project coverage change: +0.1% 🎉

Comparison is base (c768c7d) 67.5% compared to head (fca3c20) 67.6%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #4428     +/-   ##
=======================================
+ Coverage   67.5%   67.6%   +0.1%     
=======================================
  Files        159     159             
  Lines      18772   18784     +12     
=======================================
+ Hits       12679   12711     +32     
+ Misses      5328    5310     -18     
+ Partials     765     763      -2     
Files Changed Coverage Δ
internal/dataplane/kongstate/util.go 90.8% <61.5%> (+0.9%) ⬆️
internal/dataplane/kongstate/kongstate.go 72.3% <81.8%> (+0.8%) ⬆️
internal/dataplane/parser/parser.go 83.4% <100.0%> (+0.7%) ⬆️

... and 6 files with indirect coverage changes

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

@czeslavo czeslavo merged commit 04c465e into main Jul 31, 2023
30 checks passed
@czeslavo czeslavo deleted the propagate-plugin-errors branch July 31, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/feature New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants