mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
refactor cluster network related constants
This commit is contained in:
@@ -160,7 +160,7 @@ func (c *Cluster) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*p
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "create IPAM manager: %v", err)
|
||||
}
|
||||
subnet, err := ipam.AllocateSubnetLen(network.DefaultSubnetBits)
|
||||
subnet, err := ipam.AllocateSubnetLen(DefaultSubnetBits)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "allocate subnet for machine: %v", err)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ import (
|
||||
"net/netip"
|
||||
)
|
||||
|
||||
const DefaultSubnetBits = 24
|
||||
|
||||
var DefaultNetwork = netip.MustParsePrefix("10.210.0.0/16")
|
||||
|
||||
// IPAM is an in-memory IP address manager for allocating and releasing subnets for machines from a cluster network.
|
||||
type IPAM struct {
|
||||
network netip.Prefix
|
||||
|
||||
Reference in New Issue
Block a user