mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
refactor network operations into networkController to start/stop when joining/leaving cluster
This commit is contained in:
1 parent
3f497b5e58
commit
5dc0832449
5 files changed
+252
-150
No files matched your search
@@ -27,7 +27,7 @@ type Cluster struct {
|
||||
func NewCluster(state *State) *Cluster {
|
||||
return &Cluster{
|
||||
state: state,
|
||||
newMachinesCh: make(chan *pb.MachineInfo),
|
||||
newMachinesCh: make(chan *pb.MachineInfo, 1),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,6 @@ func (c *Cluster) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*p
|
||||
|
||||
// TODO: notify all cluster machines about the new machine so they can update their peers config.
|
||||
// In PoC we just notify the local machine.
|
||||
// TODO: there is a race condition with network configuration if a new cluster is initialized on the machine.
|
||||
c.newMachinesCh <- m
|
||||
|
||||
resp := &pb.AddMachineResponse{Machine: m}
|
||||
|
||||
Reference in new issue
Block a user