-
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 consumers handling when custom_id is used
Right now, when a consumer has the `username` equal to the `custom_id` of another consumer, decK fails because of the way the consumers are handled in the internal in-memory DB. ``` _format_version: "3.0" consumers: - custom_id: foo id: ce49186d-7670-445d-a218-897631b29ada username: Foo - custom_id: bar id: 7820f383-7b77-4fcc-af7f-14ff3e256693 username: foo ``` ``` $ deck sync Error: inserting consumer into state: inserting consumer Foo: entity already exists ``` This commit fixes this defect by modifying the way consumers are looked up in the in-memory DB.
- Loading branch information
Showing
9 changed files
with
88 additions
and
26 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
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
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
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
8 changes: 8 additions & 0 deletions
8
tests/integration/testdata/sync/024-consumers-with-custom_id-and-username/kong3x.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,8 @@ | ||
_format_version: "3.0" | ||
consumers: | ||
- custom_id: foo | ||
id: ce49186d-7670-445d-a218-897631b29ada | ||
username: Foo | ||
- custom_id: bar | ||
id: 7820f383-7b77-4fcc-af7f-14ff3e256693 | ||
username: foo |
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