refactor storewrapper IP handling / add coordinator IP-Block

This commit is contained in:
Benedict 2022-03-30 14:28:14 +02:00 committed by Benedict Schlüter
parent 04be09d5d3
commit 8a6825c429
7 changed files with 361 additions and 159 deletions

View file

@ -40,6 +40,10 @@ func (a *API) ActivateAsCoordinator(in *pubproto.ActivateAsCoordinatorRequest, s
// AdvanceState MUST be called before any other functions that are not sanity checks or otherwise required
// This ensures the node is marked as initialzed before the node is in a state that allows code execution
// Any new additions to ActivateAsNode MUST come after
if err := a.core.InitializeStoreIPs(); err != nil {
return status.Errorf(codes.Internal, "failed to initialize store IPs %v", err)
}
ownerID, clusterID, err := a.core.GetIDs(in.MasterSecret)
if err != nil {
return status.Errorf(codes.Internal, "%v", err)
@ -166,7 +170,7 @@ func (a *API) activateNodes(logToCLI logFunc, nodePublicEndpoints []string, coor
// Activate all nodes.
for num, nodePublicEndpoint := range nodePublicEndpoints {
logToCLI("activating node %3d out of %3d nodes", num+1, len(nodePublicEndpoints))
nodeVPNIP, err := a.core.GenerateNextIP()
nodeVPNIP, err := a.core.GetNextNodeIP()
if err != nil {
a.logger.Error("generation of vpn ips failed", zap.Error(err))
return err