etcdmain: Refactor etcdStart for use in embedding etcd servers #5584

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@purpleidea
Contributor

This patch refactors out the important (and often non-public) portions
of etcdStart that need to get run for use in embedding an etcd server.
This will allow projects just as mgmt (config) to embed etcd without
duplicating code, or trailing behind the latest upstream etcd changes.
It puts all of the common network connection code into a new struct...

@purpleidea
Contributor

This is a new, improved cleaner take on #5432. Don't merge yet, it's still a WIP, but I wanted to push it up to run some tests...

@purpleidea
Contributor

Whoever... I think this is ready for review now. I'm not sure why there is a failure, but it's only on go 1.5 on one arch. Might be unrelated to this patch. I can confirm it works for me!

@purpleidea
Contributor

@xiang90 I decided to write this anyways, in the hopes that you would accept as a good intermediate solution until something more permanent can be written. It is clean and easier to understand, as well as will solve most or all use cases for embedding etcd.

As well, if you like this patch, I am happy to update it with comprehensive documentation to describe this. I will also add a note to say that this interface is not to be considered stable for now, in case you'd like to change it in the future.

Thanks again for all your reviews.

@purpleidea
Contributor

/cc @heyitsanthony who mentioned he'd look at this too. Thanks.

@purpleidea purpleidea etcdmain: Refactor etcdStart for use in embedding etcd servers
This patch refactors out the important (and often non-public) portions
of etcdStart that need to get run for use in embedding an etcd server.
This will allow projects just as `mgmt` (config) to embed etcd without
duplicating code, or trailing behind the latest upstream etcd changes.
It puts all of the common network connection code into a new struct...
f89aaa5
@purpleidea
Contributor

FWIW The tests pass on my machine once I patch kr/pty#21 (comment) I have no idea what's failing, but the code does work correctly. Thanks for your consideration.

@purpleidea
Contributor

@xiang90 got a chance to have a look or follow up on your idea from #5432 ? Thanks!

@purpleidea purpleidea added a commit to purpleidea/mgmt that referenced this pull request Jun 18, 2016
@purpleidea purpleidea Copy in out of tree patches
These patches are proposed upstream changes and code for and from etcd.
Ideally we would revert this patch when/if things are merged upstream!
The majority of the work is in: coreos/etcd#5584
d26b503
@heyitsanthony
Contributor

Superseded by #5925. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment