Respect a requested PortalIP if possible

This commit is contained in:
Tim Hockin
2014-10-24 10:28:39 -07:00
parent fca05982fc
commit bb5ca0f91b
7 changed files with 62 additions and 18 deletions

View File

@@ -56,7 +56,8 @@ func (r *ServiceRegistry) CreateService(ctx api.Context, svc *api.Service) error
r.mu.Lock()
defer r.mu.Unlock()
r.Service = svc
r.Service = new(api.Service)
*r.Service = *svc
r.List.Items = append(r.List.Items, *svc)
return r.Err
}
@@ -83,7 +84,7 @@ func (r *ServiceRegistry) UpdateService(ctx api.Context, svc *api.Service) error
defer r.mu.Unlock()
r.UpdatedID = svc.Name
r.Service = svc
*r.Service = *svc
return r.Err
}