-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update consumers when custom_id is also set
Right now decK only uses ID and Username for Consumers lookup, which is problematic because CustomID is also unique and modifying a Username causes a Consumer re-creation, which triggers a collision for the CustomID field. This PR makes sure that CustomID is included in the lookup loop, so that such Consumers changes can be made in-place.
- Loading branch information
Showing
9 changed files
with
134 additions
and
3 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
4 changes: 4 additions & 0 deletions
4
...s/integration/testdata/sync/011-update-username-consumer-with-custom-id/kong-initial.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,4 @@ | ||
_format_version: "1.1" | ||
consumers: | ||
- custom_id: custom_test | ||
username: test |
4 changes: 4 additions & 0 deletions
4
tests/integration/testdata/sync/011-update-username-consumer-with-custom-id/kong.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,4 @@ | ||
_format_version: "1.1" | ||
consumers: | ||
- custom_id: custom_test | ||
username: test_new |
4 changes: 4 additions & 0 deletions
4
tests/integration/testdata/sync/012-update-consumer-with-custom-id/kong-initial.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,4 @@ | ||
_format_version: "1.1" | ||
consumers: | ||
- custom_id: custom_test | ||
username: test |
4 changes: 4 additions & 0 deletions
4
tests/integration/testdata/sync/012-update-consumer-with-custom-id/kong.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,4 @@ | ||
_format_version: "1.1" | ||
consumers: | ||
- custom_id: new_custom_test | ||
username: test |