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: log an error when configuration fails to get applied and KongConfigurationApplyFailed is emitted #5763

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Mar 28, 2024

What this PR does / why we need it:

This PR will make KIC emit error logs for each error that is emitted as KongConfigurationApplyFailed event to help users discover errors in their configuration.

Example:

2024-03-28T11:09:33+01:00	error	recording a Warning event for object	{"name": "alice1", "namespace": "default", "kind": "KongConsumer", "apiVersion": "configuration.konghq.com/v1", "reason": "KongConfigurationApplyFailed", "message": "invalid consumer:: uniqueness violation: 'consumers' entity with username set to 'alice' already declared", "error": "object failed to apply"}

Which issue this PR fixes:

Part of #5431

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

@pmalek pmalek added this to the KIC v3.2.x milestone Mar 28, 2024
@pmalek pmalek self-assigned this Mar 28, 2024
@pmalek pmalek requested a review from a team as a code owner March 28, 2024 10:09
Copy link
Member

@programmer04 programmer04 left a comment

Choose a reason for hiding this comment

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

It'd be useful. Btw. problem with an error log reported in #5431 is a problem with Kong Gateway - it doesn't send a response in the expected format. Several similar issues have been reported to them

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.4%. Comparing base (09f1e55) to head (89ea50a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5763   +/-   ##
=====================================
  Coverage   73.4%   73.4%           
=====================================
  Files        175     175           
  Lines      18147   18158   +11     
=====================================
+ Hits       13321   13342   +21     
+ Misses      3851    3844    -7     
+ Partials     975     972    -3     

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

@pmalek
Copy link
Member Author

pmalek commented Mar 28, 2024

problem with an error log reported in #5431 is a problem with Kong Gateway - it doesn't send a response in the expected format.

👍

#5762 will cover logging the errors that are not in the expected format

@pmalek pmalek merged commit f87ab88 into main Mar 28, 2024
48 checks passed
@pmalek pmalek deleted the log-error-when-configuration-fails-to-be-applied branch March 28, 2024 14:15
team-k8s-bot pushed a commit that referenced this pull request Apr 2, 2024
…nfigurationApplyFailed is emitted (#5763)

(cherry picked from commit f87ab88)
pmalek added a commit that referenced this pull request Apr 2, 2024
…nfigurationApplyFailed is emitted (#5763) (#5790)

(cherry picked from commit f87ab88)

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
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.

None yet

2 participants