Documentation
¶
Index ¶
- func ExtractCIDRPrefix(cidr string) string
- func GetInterfaceIPv4(ifaceName string) (string, error)
- type NetworkManager
- func (nm *NetworkManager) AddHostsEntry(ctx context.Context, clusterName, baseDomain, vip string) error
- func (nm *NetworkManager) AddVIPAlias(ctx context.Context, iface, ip, cidr string) error
- func (nm *NetworkManager) CheckVIPExists(ctx context.Context, iface, ip string) (bool, error)
- func (nm *NetworkManager) RemoveHostsEntry(ctx context.Context, clusterName string) error
- func (nm *NetworkManager) RemoveVIPAlias(ctx context.Context, iface, ip, cidr, controllerIP string) error
- func (nm *NetworkManager) VerifyVIPPersistence(ctx context.Context, iface, ip string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractCIDRPrefix ¶
ExtractCIDRPrefix extracts the prefix from a CIDR notation (e.g., "192.0.2.0/20" -> "20")
func GetInterfaceIPv4 ¶
GetInterfaceIPv4 discovers the primary IPv4 address of a given network interface (e.g., "eth0")
Types ¶
type NetworkManager ¶
type NetworkManager struct {
// contains filtered or unexported fields
}
NetworkManager handles local network configuration for the Controller node
func NewNetworkManager ¶
func NewNetworkManager(executor *localexec.LocalClient, debug bool, log *logger.Logger) *NetworkManager
NewNetworkManager creates a new local NetworkManager instance
func (*NetworkManager) AddHostsEntry ¶
func (nm *NetworkManager) AddHostsEntry(ctx context.Context, clusterName, baseDomain, vip string) error
AddHostsEntry appends the cluster API endpoints to the controller's /etc/hosts file so the local openshift-install binary can resolve them without modifying the system DNS.
func (*NetworkManager) AddVIPAlias ¶
func (nm *NetworkManager) AddVIPAlias(ctx context.Context, iface, ip, cidr string) error
AddVIPAlias appends a secondary IP to the EXISTING connection profile via nmcli
func (*NetworkManager) CheckVIPExists ¶
CheckVIPExists checks if a VIP is already configured on an interface
func (*NetworkManager) RemoveHostsEntry ¶
func (nm *NetworkManager) RemoveHostsEntry(ctx context.Context, clusterName string) error
RemoveHostsEntry safely removes the cluster's specific API endpoints from the hosts file
func (*NetworkManager) RemoveVIPAlias ¶
func (nm *NetworkManager) RemoveVIPAlias(ctx context.Context, iface, ip, cidr, controllerIP string) error
RemoveVIPAlias dynamically identifies and removes a specific VIP alias from the interface while leaving all other active cluster VIPs and the primary IP completely intact.
func (*NetworkManager) VerifyVIPPersistence ¶
VerifyVIPPersistence checks if the VIP is defined in the connection profile