-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct inconsistency for multiple consumers with custom_id fields
This commit corrects a bug preventing consumers with equal `Username` and `CustomID` to always be correctly handled by decK. For example, syncing the following state file works as expected: ``` $ cat kong.yaml _format_version: "3.0" consumers: - username: TestUser - username: OtherUser custom_id: TestUser ``` ``` $ deck sync creating consumer OtherUser creating consumer TestUser Summary: Created: 2 Updated: 0 Deleted: 0 ``` But syncing the following state file (same content as the first one, but with consumers in reverse order) doesn't work: ``` _format_version: "3.0" consumers: - username: OtherUser custom_id: TestUser - username: TestUser ``` ``` $ deck sync Error: building state: inserting consumer TestUser: entity already exists ``` This commit is making sure this bogus inconsistency is corrected.
- Loading branch information
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...gration/testdata/sync/024-consumers-with-custom_id-and-username/kong3x-reverse-order.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_format_version: "3.0" | ||
consumers: | ||
- username: OtherUser | ||
custom_id: TestUser | ||
- username: TestUser |