remove list endpoint from runtime and stop checking type in update
This commit is contained in:
parent
dca5305e8a
commit
16db76bee2
@ -422,39 +422,10 @@ func (k *kubernetes) Read(opts ...runtime.ReadOption) ([]*runtime.Service, error
|
|||||||
return services, nil
|
return services, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// List the managed services
|
|
||||||
func (k *kubernetes) List() ([]*runtime.Service, error) {
|
|
||||||
k.Lock()
|
|
||||||
defer k.Unlock()
|
|
||||||
|
|
||||||
labels := map[string]string{
|
|
||||||
"micro": k.options.Type,
|
|
||||||
}
|
|
||||||
|
|
||||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
|
||||||
logger.Debugf("Runtime listing all micro services")
|
|
||||||
}
|
|
||||||
|
|
||||||
srvs, err := k.getService(labels)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var services []*runtime.Service
|
|
||||||
for _, service := range srvs {
|
|
||||||
services = append(services, service.Service)
|
|
||||||
}
|
|
||||||
|
|
||||||
return services, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the service in place
|
// Update the service in place
|
||||||
func (k *kubernetes) Update(s *runtime.Service) error {
|
func (k *kubernetes) Update(s *runtime.Service) error {
|
||||||
// get the existing service
|
// TODO: set the type
|
||||||
// set the default labels
|
labels := map[string]string{}
|
||||||
labels := map[string]string{
|
|
||||||
"micro": k.options.Type,
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(s.Name) > 0 {
|
if len(s.Name) > 0 {
|
||||||
labels["name"] = client.Format(s.Name)
|
labels["name"] = client.Format(s.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user