-
Notifications
You must be signed in to change notification settings - Fork 16
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
Move the Maybe Datacenter into the ConsulClient, drop from requests #33
Conversation
803fa72
to
afee76b
Compare
All those issues noted above have been resolved (see #36 and #38), and this PR has been updated/rebased. I also have a version of this PR that is based on #39, though I'm not sure that one is good to merge, so I haven't pushed it. @nh2, LMK if I should update this after merging that PR, or if this should be first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR description is great, we should copy it into the changelog when we make this API backwards incompatble release.
The only thing you might want to add is that it is still very easy to provide a custom datacenter by updating the client
record:
- x <- getKey client "nokey" Nothing Nothing Nothing
+ x <- getKey client{ ccDatacenter = Datacenter "mydc" } "nokey" Nothing Nothing
I've made a small change request to maintain the Maybe
-ness of the ccDatacenter
.
afee76b
to
dcb12c4
Compare
This should now be complete. |
65840c6
to
efda2f1
Compare
OK, #39 was updated and merged, so I've rebased this PR and confirmed tests are passing. This also addresses the |
@nh2 maybe you can review? I am blocked without a thumbs up or more changes to make. |
6f66a50
to
e72839b
Compare
We can still declare a Datacenter to use when initializing our client: ``` x <- getKey client{ ccDatacenter = Datacenter "mydc" } "nokey" Nothing Nothing ```
Don't wait, we need it now as part of the v0.6.0 release's breaking change. We'll continue to update the CHANGELOG with entries for previous releases.
e72839b
to
0b389d4
Compare
This update move the Datacenter into the ConsulClient data structure. In effect, we're saying a "client connection" specifies the datacenter. So if you want to interact with multiple datacenters in a consul cluster, you would have multiple clients. I think this is a good thing, as MOST of the time, there's a single datacenter we're targeting, and if/when there are multiple, having separate clients is a great way to keep the code clean and obvious.
With this change, the datacenter doesn't need to be passed around outside the client, we can simply rely on the client data structure to contain the info we need for the interaction with consul.
With this update, users will need to change their calling code to use the library (dropping the Maybe Datacenter from most functions, and specifying it when initializing the client). An example of that update looks like:
While we will want to update
async
towithAsync
as well, these changes will result in a version bump to0.6.0
.This contributes to #32.