Help us shape the future of Go! Take the 2026 Go Developer Survey

controller

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCIDRPrefix

func ExtractCIDRPrefix(cidr string) string

ExtractCIDRPrefix extracts the prefix from a CIDR notation (e.g., "192.0.2.0/20" -> "20")

func GetInterfaceIPv4

func GetInterfaceIPv4(ifaceName string) (string, error)

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

func (nm *NetworkManager) CheckVIPExists(ctx context.Context, iface, ip string) (bool, error)

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

func (nm *NetworkManager) VerifyVIPPersistence(ctx context.Context, iface, ip string) (bool, error)

VerifyVIPPersistence checks if the VIP is defined in the connection profile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL