nocloud

package
v1.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package nocloud provides the NoCloud platform implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bonds

type Bonds struct {
	Ethernet   `yaml:",inline"`
	Interfaces []string `yaml:"interfaces,omitempty"`
	Params     struct {
		Mode       string `yaml:"mode,omitempty"`
		LACPRate   string `yaml:"lacp-rate,omitempty"`
		HashPolicy string `yaml:"transmit-hash-policy,omitempty"`
		MIIMon     uint32 `yaml:"mii-monitor-interval,omitempty"`
		UpDelay    uint32 `yaml:"up-delay,omitempty"`
		DownDelay  uint32 `yaml:"down-delay,omitempty"`
	} `yaml:"parameters,omitempty"`
}

Bonds holds bonding interface info.

type Ethernet

type Ethernet struct {
	Match struct {
		Name   string `yaml:"name,omitempty"`
		HWAddr string `yaml:"macaddress,omitempty"`
	} `yaml:"match,omitempty"`
	DHCPv4      bool     `yaml:"dhcp4,omitempty"`
	DHCPv6      bool     `yaml:"dhcp6,omitempty"`
	Address     []string `yaml:"addresses,omitempty"`
	Gateway4    string   `yaml:"gateway4,omitempty"`
	Gateway6    string   `yaml:"gateway6,omitempty"`
	MTU         uint32   `yaml:"mtu,omitempty"`
	NameServers struct {
		Search  []string `yaml:"search,omitempty"`
		Address []string `yaml:"addresses,omitempty"`
	} `yaml:"nameservers,omitempty"`
	Routes []struct {
		To     string `yaml:"to,omitempty"`
		Via    string `yaml:"via,omitempty"`
		Metric string `yaml:"metric,omitempty"`
		Table  uint32 `yaml:"table,omitempty"`
	} `yaml:"routes,omitempty"`
	RoutingPolicy []struct {
		From  string `yaml:"froom,omitempty"`
		Table uint32 `yaml:"table,omitempty"`
	} `yaml:"routing-policy,omitempty"`
}

Ethernet holds network interface info.

type MetadataConfig

type MetadataConfig struct {
	Hostname      string `yaml:"hostname,omitempty"`
	LocalHostname string `yaml:"local-hostname,omitempty"`
	InstanceID    string `yaml:"instance-id,omitempty"`
	InstanceType  string `yaml:"instance-type,omitempty"`
	ProviderID    string `yaml:"provider-id,omitempty"`
	Region        string `yaml:"region,omitempty"`
	Zone          string `yaml:"zone,omitempty"`
}

MetadataConfig holds meta info.

type NetworkConfig

type NetworkConfig struct {
	Version int `yaml:"version"`
	Config  []struct {
		Mac        string `yaml:"mac_address,omitempty"`
		Interfaces string `yaml:"name,omitempty"`
		MTU        uint32 `yaml:"mtu,omitempty"`
		Subnets    []struct {
			Address string `yaml:"address,omitempty"`
			Netmask string `yaml:"netmask,omitempty"`
			Gateway string `yaml:"gateway,omitempty"`
			Type    string `yaml:"type"`
		} `yaml:"subnets,omitempty"`
		Address []string `yaml:"address,omitempty"`
		Type    string   `yaml:"type"`
	} `yaml:"config,omitempty"`
	Ethernets map[string]Ethernet `yaml:"ethernets,omitempty"`
	Bonds     map[string]Bonds    `yaml:"bonds,omitempty"`
}

NetworkConfig holds network-config info.

type Nocloud

type Nocloud struct{}

Nocloud is the concrete type that implements the runtime.Platform interface.

func (*Nocloud) Configuration

func (n *Nocloud) Configuration(ctx context.Context, r state.State) ([]byte, error)

Configuration implements the runtime.Platform interface.

func (*Nocloud) KernelArgs

func (n *Nocloud) KernelArgs() procfs.Parameters

KernelArgs implements the runtime.Platform interface.

func (*Nocloud) Mode

func (n *Nocloud) Mode() runtime.Mode

Mode implements the runtime.Platform interface.

func (*Nocloud) Name

func (n *Nocloud) Name() string

Name implements the runtime.Platform interface.

func (*Nocloud) NetworkConfiguration

func (n *Nocloud) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error

NetworkConfiguration implements the runtime.Platform interface.

func (*Nocloud) ParseMetadata

func (n *Nocloud) ParseMetadata(unmarshalledNetworkConfig *NetworkConfig, st state.State, metadata *MetadataConfig) (*runtime.PlatformNetworkConfig, error)

ParseMetadata converts nocloud metadata to platform network config.

Jump to

Keyboard shortcuts

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