kongfig icon indicating copy to clipboard operation
kongfig copied to clipboard

ensure flag doesn't work with consumer credentials

Open eamonnmcevoy opened this issue 7 years ago • 1 comments

In my kongifg file I have a test consumer with basic auth credentials, when I run kongfig (after the initial run) I get an error:

409 Conflict { username: 'already exists with value \'myuser\'' }

Error: Conflict
{"username":"already exists with value 'myuser'"}

 Error: Conflict
{"username":"already exists with value 'myuser'"}

    at /usr/local/lib/node_modules/kongfig/lib/core.js:346:45
    at run (/usr/local/lib/node_modules/kongfig/node_modules/core-js/modules/es6.promise.js:75:22)
    at /usr/local/lib/node_modules/kongfig/node_modules/core-js/modules/es6.promise.js:92:30
    at flush (/usr/local/lib/node_modules/kongfig/node_modules/core-js/modules/_microtask.js:18:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

I tried using the ensure flag for this but it didn't help

   consumers: 
      - username: my-user
        ensure: "present"
        credentials:
          - name: basic-auth
            ensure: "present"
            attributes:
              username: my-username
              password: password

Is there a way to ensure this consumer will be present in kong

eamonnmcevoy avatar Aug 27 '18 16:08 eamonnmcevoy

https://docs.konghq.com/0.11.x/admin-api/#retrieve-consumer

albertux avatar Sep 18 '18 03:09 albertux