mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-21 22:49:31 +00:00
Implement minion registry. Minions now a first-class object.
This commit is contained in:
@@ -30,14 +30,14 @@ import (
|
||||
type ServiceRegistryStorage struct {
|
||||
registry ServiceRegistry
|
||||
cloud cloudprovider.Interface
|
||||
hosts []string
|
||||
machines MinionRegistry
|
||||
}
|
||||
|
||||
func MakeServiceRegistryStorage(registry ServiceRegistry, cloud cloudprovider.Interface, hosts []string) apiserver.RESTStorage {
|
||||
func MakeServiceRegistryStorage(registry ServiceRegistry, cloud cloudprovider.Interface, machines MinionRegistry) apiserver.RESTStorage {
|
||||
return &ServiceRegistryStorage{
|
||||
registry: registry,
|
||||
cloud: cloud,
|
||||
hosts: hosts,
|
||||
machines: machines,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,11 @@ func (sr *ServiceRegistryStorage) Create(obj interface{}) (<-chan interface{}, e
|
||||
balancer, ok = sr.cloud.TCPLoadBalancer()
|
||||
}
|
||||
if ok && balancer != nil {
|
||||
err := balancer.CreateTCPLoadBalancer(srv.ID, "us-central1", srv.Port, sr.hosts)
|
||||
hosts, err := sr.machines.List()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = balancer.CreateTCPLoadBalancer(srv.ID, "us-central1", srv.Port, hosts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user