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: translate only one if multiple KongVaults with the same spec.prefix #5435

Merged
merged 5 commits into from
Jan 16, 2024

Conversation

randmonkey
Copy link
Contributor

@randmonkey randmonkey commented Jan 15, 2024

What this PR does / why we need it:

Translate only one of KongVaults and record translation failure events for the others if they have the same spec.prefix to avoid generating vaults with the same prefix in Kong configuration. The "winner" is chosen by the following rules:

  • The one created earlier (earliest metadata.creationTimestamp)
  • The one having name in smaller lexical order if the creation timestamp is the same.

And the PR also sets spec.prefix to be immutable.

Which issue this PR fixes:

fixes #5423

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

@randmonkey randmonkey requested a review from a team as a code owner January 15, 2024 08:13
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

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

Comparison is base (785b0cb) 69.3% compared to head (694f63a) 69.5%.

Files Patch % Lines
internal/dataplane/kongstate/kongstate.go 90.3% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5435     +/-   ##
=======================================
+ Coverage   69.3%   69.5%   +0.1%     
=======================================
  Files        176     176             
  Lines      22386   22415     +29     
=======================================
+ Hits       15533   15579     +46     
+ Misses      5929    5916     -13     
+ Partials     924     920      -4     

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

@randmonkey randmonkey self-assigned this Jan 15, 2024
@randmonkey randmonkey added area/feature New feature or request area/CRD Changes in existing CRDs or introduction of new ones labels Jan 15, 2024
@randmonkey randmonkey force-pushed the feat/tie_breaker_dupe_prefix_vaults branch from eaa430f to 694f63a Compare January 16, 2024 08:01
@randmonkey randmonkey merged commit d5f068d into main Jan 16, 2024
37 checks passed
@randmonkey randmonkey deleted the feat/tie_breaker_dupe_prefix_vaults branch January 16, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CRD Changes in existing CRDs or introduction of new ones area/feature New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject KongVault with duplicate spec.prefix and generate translation error events
2 participants