nocloud

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MPL-2.0 Imports: 24 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 {
	Interfaces  []string `yaml:"interfaces,omitempty"`
	Address     []string `yaml:"addresses,omitempty"`
	NameServers struct {
		Search  []string `yaml:"search,omitempty"`
		Address []string `yaml:"addresses,omitempty"`
	} `yaml:"nameservers,omitempty"`
	Params []struct {
		Mode       string `yaml:"mode,omitempty"`
		LACPRate   string `yaml:"lacp-rate,omitempty"`
		HashPolicy string `yaml:"transmit-hash-policy,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         int      `yaml:"mtu,omitempty"`
	NameServers struct {
		Search  []string `yaml:"search,omitempty"`
		Address []string `yaml:"addresses,omitempty"`
	} `yaml:"nameservers,omitempty"`
}

Ethernet holds network interface info.

type MetadataConfig

type MetadataConfig struct {
	Hostname     string `yaml:"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        string `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, _ state.State, ch chan<- *runtime.PlatformNetworkConfig) error

NetworkConfiguration implements the runtime.Platform interface.

func (*Nocloud) ParseMetadata

func (n *Nocloud) ParseMetadata(unmarshalledNetworkConfig *NetworkConfig, 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