CrunchyData / bridge-cli

CLI for Crunchy Bridge
GNU General Public License v3.0
24 stars 4 forks source link

Fix `cb uri` hostname for replicas using `user` role. #162

Closed abrightwell closed 5 months ago

abrightwell commented 5 months ago

It was reported that using cb uri to retrieve credentials for a user role on a replica was returning the hostname of the primary instead of the target replica.

This was because it's possible that theuser role does not exist yet and therefore would need to first be created on the primary. So, to ensure that it is, we always attempt to create it on the primary and then retrieve it for the replica. Previously, we were only creating it and that was resulting in the returned credentials to be associated with the primary. So, we've now eliminated that branch in the code so that it will always retrieve this information from the correct target.

abrightwell commented 5 months ago

Thanks!