mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
rename Machine message to MachineInfo to not conflict with the service name
This commit is contained in:
@@ -75,7 +75,7 @@ func (c *Server) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*pb
|
||||
if manageIP == nil {
|
||||
manageIP = pb.NewIP(network.ManagementIP(req.Network.PublicKey))
|
||||
}
|
||||
m := &pb.Machine{
|
||||
m := &pb.MachineInfo{
|
||||
Id: mid,
|
||||
Name: req.Name,
|
||||
Network: &pb.NetworkConfig{
|
||||
@@ -105,7 +105,7 @@ func (c *Server) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*pb
|
||||
m.Network.Subnet = pb.NewIPPrefix(subnet)
|
||||
|
||||
// TODO: announce the new machine to the cluster network using Serf and achieve consensus.
|
||||
mState := proto.Clone(m).(*pb.Machine)
|
||||
mState := proto.Clone(m).(*pb.MachineInfo)
|
||||
c.state.State.Machines[mState.Id] = mState
|
||||
// Store machine endpoints in a separate collection to allow modifying them with limited permissions.
|
||||
c.state.State.Endpoints[mState.Id] = &pb.MachineEndpoints{
|
||||
|
||||
@@ -17,7 +17,7 @@ func StatePath(dataDir string) string {
|
||||
func NewState(path string) *State {
|
||||
return &State{
|
||||
State: &pb.State{
|
||||
Machines: make(map[string]*pb.Machine),
|
||||
Machines: make(map[string]*pb.MachineInfo),
|
||||
Endpoints: make(map[string]*pb.MachineEndpoints),
|
||||
},
|
||||
path: path,
|
||||
@@ -33,7 +33,7 @@ func (s *State) Load() error {
|
||||
return fmt.Errorf("parse state file %q: %w", s.path, err)
|
||||
}
|
||||
if s.State.Machines == nil {
|
||||
s.State.Machines = make(map[string]*pb.Machine)
|
||||
s.State.Machines = make(map[string]*pb.MachineInfo)
|
||||
}
|
||||
if s.State.Endpoints == nil {
|
||||
s.State.Endpoints = make(map[string]*pb.MachineEndpoints)
|
||||
|
||||
Reference in New Issue
Block a user