manifests

package
v0.0.0-...-fc91f8f Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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
  1. *.nmconnections - files generated by nmstate based on yaml files provided by the user
  2. mac_interface.ini - the file contains mapping of mac-address to logical interface name. There are two usages for the file:
  3. 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.
  4. 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:

  1. 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.
  2. Replace logical interface name in nmconnection files with the interface name as set on the host
  3. Rename nmconnection files to start with the interface name (instead of the logical interface name)
  4. Copy the nmconnection files to /NetworkManager/system-connections/

Variables

This section is empty.

Functions

func GetAgentClusterInstall

func GetAgentClusterInstall() (hiveext.AgentClusterInstall, error)

func GetFileData

func GetFileData(fileName string, output interface{}) error

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 GetInfraEnv() (aiv1beta1.InfraEnv, error)

func GetNMIgnitionFiles

func GetNMIgnitionFiles(staticNetworkConfig []*models.HostStaticNetworkConfig) ([]staticnetworkconfig.StaticNetworkConfigData, error)

Get the NetworkManager configuration files

func GetPullSecret

func GetPullSecret() (string, error)

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

func (n NMConfig) GetNodeZeroIP() string

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)

Jump to

Keyboard shortcuts

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