ubccr / grendel

Bare Metal Provisioning system for HPC Linux clusters
https://grendel.readthedocs.io
GNU General Public License v3.0
57 stars 13 forks source link

Refactor how we store IP addresses #22

Closed aebruno closed 1 year ago

aebruno commented 1 year ago

This PR contains the following refactoring:

  1. Changes the NetInterface.IP type from net.IP to netip.Prefix which allows us to capture both the IP address and the network prefix. The raw IP stored in the json now has the following format: x.x.x.x/xx. This is a breaking change and will require a dump/restore of the grendel database.
  2. Adds subnet config settings to define gateway, dns, search domains and mtu. If a host IP falls in the subnet grendel will inherit these settings when offering dhcp leases.
  3. Add helper methods on the model.NetInterface struct to allow easier and more consisten access to ip, netmask, gateway, dns etc.
  4. Refactor how we generate URLs for the various provision endpoints. These are needed in dhcp options as well as provision templates.
  5. Rename "dhcp.router" config option to "dhcp.gateway" and remove unused "provision.scheme" config option
  6. Add support for serving custom named provision templates