Documentation ¶
Overview ¶
Package kube is a backend implementation that uses the Tinkerbell CRDs to get DHCP data.
Index ¶
- Constants
- func GetIPs(h *v1alpha1.Hardware) []string
- func GetMACs(h *v1alpha1.Hardware) []string
- func IPAddrs(obj client.Object) []string
- func MACAddrs(obj client.Object) []string
- type Backend
- func (b *Backend) GetByIP(ctx context.Context, ip net.IP) (*data.DHCP, *data.Netboot, error)
- func (b *Backend) GetByMac(ctx context.Context, mac net.HardwareAddr) (*data.DHCP, *data.Netboot, error)
- func (b *Backend) RegisterHw(ctx context.Context, hwObject v1alpha1.Hardware) error
- func (b *Backend) Start(ctx context.Context) error
Constants ¶
const IPAddrIndex = ".Spec.Interfaces.DHCP.IP"
IPAddrIndex is an index used with a controller-runtime client to lookup hardware by IP.
const MACAddrIndex = ".Spec.Interfaces.MAC"
MACAddrIndex is an index used with a controller-runtime client to lookup hardware by MAC.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a backend implementation that uses the Tinkerbell CRDs to get DHCP data.
func NewBackend ¶
NewBackend returns a controller-runtime cluster.Cluster with the Tinkerbell runtime scheme registered, and indexers for: * Hardware by MAC address * Hardware by IP address
Callers must instantiate the client-side cache by calling Start() before use.
func (*Backend) GetByIP ¶
GetByIP implements the handler.BackendReader interface and returns DHCP and netboot data based on an IP address.
func (*Backend) GetByMac ¶
func (b *Backend) GetByMac(ctx context.Context, mac net.HardwareAddr) (*data.DHCP, *data.Netboot, error)
GetByMac implements the handler.BackendReader interface and returns DHCP and netboot data based on a mac address.
func (*Backend) RegisterHw ¶
RegisterHw implements the handler.BackendReader interface and returns DHCP and netboot data based on an IP address.