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

fix: correct inconsistency for multiple consumers with custom_id fields #1037

Merged
merged 1 commit into from
Sep 27, 2023

Commits on Sep 27, 2023

  1. 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.
    GGabriele committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    b43cb30 View commit details
    Browse the repository at this point in the history