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

Reject KongVault with duplicate spec.prefix and generate translation error events #5423

Closed
1 of 3 tasks
randmonkey opened this issue Jan 11, 2024 · 0 comments · Fixed by #5435
Closed
1 of 3 tasks
Assignees
Labels
area/feature New feature or request
Milestone

Comments

@randmonkey
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Problem Statement

Split from #5333 and #5395.
Since prefix field of vault should be unique in Kong gateway, when multiple KongVaults with the same spec.prefix are in the controller's cache (in case webhook is not enabled, or came to race condition that other KongVaults not yet sunxed to cache), the translator should pick only one of them and reject the others to avoid invalid Kong configuration that will cause stuck.

The tie breaker would be:

  • The KongVault created earlier (earlier creationTimestamp) should be chosen
  • If multiple KongVaults have the creationTimestamp, the one with the smallest alphabetical order should be chosen

Proposed Solution

  • Check all KongVaults' spec.prefix in translator's FillVaults method,
  • Record translation failure events to the KongVaults with duplicate spec.prefix

Additional information

No response

Acceptance Criteria

  • The translator does not generate Kong configuration with vaults having same prefix field
  • If multiple KongVaults have the same spec.vault field, only one will get translated, and others will have translation failure event recorded
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
Projects
None yet
1 participant