netconfig

package
v0.0.0-...-9fc1ca9 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PathToDefaultCnfCoreNetParamsFile path to config file with default network parameters.
	PathToDefaultCnfCoreNetParamsFile = "./default.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkConfig

type NetworkConfig struct {
	*coreconfig.CoreConfig
	CnfNetTestContainer     string `yaml:"cnf_net_test_container" envconfig:"ECO_CNF_CORE_NET_TEST_CONTAINER"`
	DpdkTestContainer       string `yaml:"dpdk_test_container" envconfig:"ECO_CNF_CORE_NET_DPDK_TEST_CONTAINER"`
	MlbOperatorNamespace    string `yaml:"metal_lb_operator_namespace" envconfig:"ECO_CNF_CORE_NET_MLB_OPERATOR_NAMESPACE"`
	CnfMcpLabel             string `yaml:"cnf_mcp_label" envconfig:"ECO_CNF_CORE_NET_CNF_MCP_LABEL"`
	MultusNamesapce         string `yaml:"multus_namespace" envconfig:"ECO_CNF_CORE_NET_MULTUS_NAMESPACE"`
	SwitchUser              string `envconfig:"ECO_CNF_CORE_NET_SWITCH_USER"`
	SwitchPass              string `envconfig:"ECO_CNF_CORE_NET_SWITCH_PASS"`
	SwitchIP                string `envconfig:"ECO_CNF_CORE_NET_SWITCH_IP"`
	SwitchInterfaces        string `envconfig:"ECO_CNF_CORE_NET_SWITCH_INTERFACES"`
	PrimarySwitchInterfaces string `envconfig:"ECO_CNF_CORE_NET_PRIMARY_SWITCH_INTERFACES"`
	SwitchLagNames          string `envconfig:"ECO_CNF_CORE_NET_SWITCH_LAGS"`
	ClusterVlan             string `envconfig:"ECO_CNF_CORE_NET_CLUSTER_VLAN"`
	//nolint:lll
	PrometheusOperatorNamespace string `yaml:"prometheus_operator_namespace" envconfig:"ECO_CNF_CORE_NET_PROMETHEUS_OPERATOR_NAMESPACE"`
	MlbAddressPoolIP            string `envconfig:"ECO_CNF_CORE_NET_MLB_ADDR_LIST"`
	SriovInterfaces             string `envconfig:"ECO_CNF_CORE_NET_SRIOV_INTERFACE_LIST"`
	FrrImage                    string `yaml:"frr_image" envconfig:"ECO_CNF_CORE_NET_FRR_IMAGE"`
	VLAN                        string `envconfig:"ECO_CNF_CORE_NET_VLAN"`
	BMCHostNames                string `envconfig:"ECO_CNF_CORE_NET_BMC_HOST_NAMES"`
	BMCHostUser                 string `envconfig:"ECO_CNF_CORE_NET_BMC_HOST_USER"`
	BMCHostPass                 string `envconfig:"ECO_CNF_CORE_NET_BMC_HOST_PASS"`
}

NetworkConfig type keeps network configuration.

func NewNetConfig

func NewNetConfig() *NetworkConfig

NewNetConfig returns instance of NetworkConfig config type.

func (*NetworkConfig) GetBMCHostNames

func (netConfig *NetworkConfig) GetBMCHostNames() ([]string, error)

GetBMCHostNames checks the environmental variable ECO_CNF_CORE_NET_BMC_HOST_NAMES and returns the value in []string.

func (*NetworkConfig) GetBMCHostPass

func (netConfig *NetworkConfig) GetBMCHostPass() (string, error)

GetBMCHostPass checks the environmental variable ECO_CNF_CORE_NET_BMC_HOST_PASS.

func (*NetworkConfig) GetBMCHostUser

func (netConfig *NetworkConfig) GetBMCHostUser() (string, error)

GetBMCHostUser checks the environmental variable ECO_CNF_CORE_NET_BMC_HOST_USER.

func (*NetworkConfig) GetClusterVlan

func (netConfig *NetworkConfig) GetClusterVlan() (string, error)

GetClusterVlan checks the environmental variable ECO_CNF_CORE_NET_CLUSTER_VLAN and returns the value in string.

func (*NetworkConfig) GetMetalLbVirIP

func (netConfig *NetworkConfig) GetMetalLbVirIP() ([]string, error)

GetMetalLbVirIP IPv4 checks the metalLbIP environmental variable and returns the list of give ip addresses.

func (*NetworkConfig) GetPrimarySwitchInterfaces

func (netConfig *NetworkConfig) GetPrimarySwitchInterfaces() ([]string, error)

GetPrimarySwitchInterfaces checks the environmental variable ECO_CNF_CORE_NET_PRIMARY_SWITCH_INTERFACES and returns the value in []string.

func (*NetworkConfig) GetSriovInterfaces

func (netConfig *NetworkConfig) GetSriovInterfaces(requestedNumber int) ([]string, error)

GetSriovInterfaces checks the ECO_CNF_CORE_NET_SRIOV_INTERFACE_LIST env var and returns required number of SR-IOV interfaces.

func (*NetworkConfig) GetSwitchIP

func (netConfig *NetworkConfig) GetSwitchIP() (string, error)

GetSwitchIP checks the environmental variable ECO_CNF_CORE_NET_SWITCH_IP and returns the value in string.

func (*NetworkConfig) GetSwitchInterfaces

func (netConfig *NetworkConfig) GetSwitchInterfaces() ([]string, error)

GetSwitchInterfaces checks the environmental variable ECO_CNF_CORE_NET_SWITCH_INTERFACES and returns the value in []string.

func (*NetworkConfig) GetSwitchLagNames

func (netConfig *NetworkConfig) GetSwitchLagNames() ([]string, error)

GetSwitchLagNames checks the environmental variable ECO_CNF_CORE_NET_SWITCH_LAGS and returns the value in []string.

func (*NetworkConfig) GetSwitchPass

func (netConfig *NetworkConfig) GetSwitchPass() (string, error)

GetSwitchPass checks the environmental variable ECO_CNF_CORE_NET_SWITCH_PASS and returns the value in string.

func (*NetworkConfig) GetSwitchUser

func (netConfig *NetworkConfig) GetSwitchUser() (string, error)

GetSwitchUser checks the environmental variable ECO_CNF_CORE_NET_SWITCH_USER and returns the value in string.

func (*NetworkConfig) GetVLAN

func (netConfig *NetworkConfig) GetVLAN() (uint16, error)

GetVLAN reads environment variable ECO_CNF_CORE_NET_VLAN and returns preconfigured vlanID.

Jump to

Keyboard shortcuts

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