Second step in decoupling the service controller, use the apiserver for writes too.

Addresses #1436 
Bah.  Open an issue for me, I'll need it for the auth stuff anyway.

> On Sep 26, 2014, at 7:36 PM, Brendan Burns <notifications@github.com> wrote:
> 
> In pkg/service/endpoints_controller.go:
> 
> > @@ -72,11 +73,34 @@ func (e *EndpointController) SyncServiceEndpoints() error {
> >  			}
> >  			endpoints[ix] = net.JoinHostPort(pod.CurrentState.PodIP, strconv.Itoa(port))
> >  		}
> > -		// TODO: this is totally broken, we need to compute this and store inside an AtomicUpdate loop.
> > -		err = e.serviceRegistry.UpdateEndpoints(api.NewContext(), &api.Endpoints{
> > -			JSONBase:  api.JSONBase{ID: service.ID},
> > +		currentEndpoints, err := e.client.GetEndpoints(service.ID)
> > +		if err != nil {
> > +			// TODO this is brittle as all get out, refactor the client libraries to return a structured error.
> > +			if strings.Contains(err.Error(), "(404)") {
> It's getting back to the client, but the client is swallowing it in Client.doRequest...
> 
> —
> Reply to this email directly or view it on GitHub.