Documentation ¶
Index ¶
- Constants
- func GetAgentClusterInstall() (hiveext.AgentClusterInstall, error)
- func GetFileData(fileName string, output interface{}) error
- func GetFileMultipleYamls(filename string, decoder DecodeFormat) ([]interface{}, error)
- func GetInfraEnv() (aiv1beta1.InfraEnv, error)
- func GetNMIgnitionFiles(staticNetworkConfig []*models.HostStaticNetworkConfig) ([]staticnetworkconfig.StaticNetworkConfigData, error)
- func GetPullSecret() (string, error)
- func ProcessNMStateConfig(infraEnv aiv1beta1.InfraEnv) ([]*models.HostStaticNetworkConfig, error)
- type DecodeFormat
- type NMConfig
- type NMStateConfig
- type NMStateConfigYamlDecoder
Constants ¶
const PreNetworkConfigScript = `` /* 4299-byte string literal not displayed */
This file is copied from https://github.com/openshift/assisted-service/blob/master/internal/constants/scripts.go as its in the internal directory so can't be imported
PreNetworkConfigScript script runs on hosts before network manager service starts in order to apply user's provided network configuration on the host. If the user provides static network configuration, the network config files will be stored in directory /etc/assisted/network in the following structure: /etc/assisted/network/
+-- host1 | +--- *.nmconnection | +--- mac_interface.ini +-- host2 +--- *.nmconnection +--- mac_interface.ini
- *.nmconnections - files generated by nmstate based on yaml files provided by the user
- mac_interface.ini - the file contains mapping of mac-address to logical interface name. There are two usages for the file:
- Map logical interface name to MAC Address of the host. The logical interface name is a name provided by the user for the interface. It will be replaced by the script with the actual network interface name.
- Identify the host directory which belongs to the current host by matching a MAC Address from the mapping file with host network interfaces.
Applying the network configuration of each host will be done by:
- Associate the current host with its matching hostX directory. The association will be done by matching host's mac addresses with those in mac_interface.ini.
- Replace logical interface name in nmconnection files with the interface name as set on the host
- Rename nmconnection files to start with the interface name (instead of the logical interface name)
- Copy the nmconnection files to /NetworkManager/system-connections/
Variables ¶
This section is empty.
Functions ¶
func GetAgentClusterInstall ¶
func GetAgentClusterInstall() (hiveext.AgentClusterInstall, error)
func GetFileData ¶
Read a Yaml file and unmarshal the contents
func GetFileMultipleYamls ¶
func GetFileMultipleYamls(filename string, decoder DecodeFormat) ([]interface{}, error)
Read a YAML file containing multiple YAML definitions of the same format Each specific format must be of type DecodeFormat
func GetInfraEnv ¶
func GetNMIgnitionFiles ¶
func GetNMIgnitionFiles(staticNetworkConfig []*models.HostStaticNetworkConfig) ([]staticnetworkconfig.StaticNetworkConfigData, error)
Get the NetworkManager configuration files
func GetPullSecret ¶
func ProcessNMStateConfig ¶
func ProcessNMStateConfig(infraEnv aiv1beta1.InfraEnv) ([]*models.HostStaticNetworkConfig, error)
Types ¶
type DecodeFormat ¶
type DecodeFormat interface {
NewDecodedYaml(decoder *yaml.YAMLToJSONDecoder) (interface{}, error)
}
type NMConfig ¶
type NMConfig struct {
// contains filtered or unexported fields
}
func NewNMConfig ¶
func NewNMConfig() NMConfig
func (NMConfig) GetNodeZeroIP ¶
Retrieve the first IP from the user provided NMStateConfig yaml file to set as node0 IP
type NMStateConfig ¶
type NMStateConfig struct { Interfaces []struct { IPV4 struct { Address []struct { IP string `yaml:"ip,omitempty"` } `yaml:"address,omitempty"` } `yaml:"ipv4,omitempty"` IPV6 struct { Address []struct { IP string `yaml:"ip,omitempty"` } `yaml:"address,omitempty"` } `yaml:"ipv6,omitempty"` } `yaml:"interfaces,omitempty"` }
type NMStateConfigYamlDecoder ¶
type NMStateConfigYamlDecoder int
func (*NMStateConfigYamlDecoder) NewDecodedYaml ¶
func (d *NMStateConfigYamlDecoder) NewDecodedYaml(yamlDecoder *yaml.YAMLToJSONDecoder) (interface{}, error)