openstack

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package openstack provides the Openstack platform implementation.

Index

Constants

View Source
const (

	// OpenstackExternalIPEndpoint is the local Openstack endpoint for the external IP.
	OpenstackExternalIPEndpoint = "http://169.254.169.254/latest/meta-data/public-ipv4"
	// OpenstackInstanceTypeEndpoint is the local Openstack endpoint for the instance-type.
	OpenstackInstanceTypeEndpoint = "http://169.254.169.254/latest/meta-data/instance-type"
	// OpenstackMetaDataEndpoint is the local Openstack endpoint for the meta config.
	OpenstackMetaDataEndpoint = "http://169.254.169.254/" + configMetadataPath
	// OpenstackNetworkDataEndpoint is the local Openstack endpoint for the network config.
	OpenstackNetworkDataEndpoint = "http://169.254.169.254/" + configNetworkDataPath
	// OpenstackUserDataEndpoint is the local Openstack endpoint for the config.
	OpenstackUserDataEndpoint = "http://169.254.169.254/" + configUserDataPath
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataConfig

type MetadataConfig struct {
	UUID             string `json:"uuid,omitempty"`
	Hostname         string `json:"hostname,omitempty"`
	AvailabilityZone string `json:"availability_zone,omitempty"`
	ProjectID        string `json:"project_id"`
	InstanceType     string `json:"instance_type"`
}

MetadataConfig holds meta info.

type NetworkConfig

type NetworkConfig struct {
	Links []struct {
		ID             string   `json:"id,omitempty"`
		Type           string   `json:"type"`
		Mac            string   `json:"ethernet_mac_address,omitempty"`
		MTU            int      `json:"mtu,omitempty"`
		BondMode       string   `json:"bond_mode,omitempty"`
		BondLinks      []string `json:"bond_links,omitempty"`
		BondMIIMon     uint32   `json:"bond_miimon,string,omitempty"`
		BondHashPolicy string   `json:"bond_xmit_hash_policy,omitempty"`
	} `json:"links"`
	Networks []struct {
		ID      string `json:"id,omitempty"`
		Link    string `json:"link"`
		Type    string `json:"type"`
		Address string `json:"ip_address,omitempty"`
		Netmask string `json:"netmask,omitempty"`
		Gateway string `json:"gateway,omitempty"`
		Routes  []struct {
			Network string `json:"network,omitempty"`
			Netmask string `json:"netmask,omitempty"`
			Gateway string `json:"gateway,omitempty"`
		} `json:"routes,omitempty"`
	} `json:"networks"`
	Services []struct {
		Type    string `json:"type"`
		Address string `json:"address"`
	} `json:"services,omitempty"`
}

NetworkConfig holds NetworkData config.

type Openstack

type Openstack struct{}

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

func (*Openstack) Configuration

func (o *Openstack) Configuration(ctx context.Context, r state.State) (machineConfig []byte, err error)

Configuration implements the runtime.Platform interface.

func (*Openstack) KernelArgs

func (o *Openstack) KernelArgs() procfs.Parameters

KernelArgs implements the runtime.Platform interface.

func (*Openstack) Mode

func (o *Openstack) Mode() runtime.Mode

Mode implements the runtime.Platform interface.

func (*Openstack) Name

func (o *Openstack) Name() string

Name implements the runtime.Platform interface.

func (*Openstack) NetworkConfiguration

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

NetworkConfiguration implements the runtime.Platform interface.

func (*Openstack) ParseMetadata

func (o *Openstack) ParseMetadata(
	ctx context.Context,
	unmarshalledNetworkConfig *NetworkConfig,
	extIPs []netip.Addr,
	metadata *MetadataConfig,
	st state.State,
) (*runtime.PlatformNetworkConfig, error)

ParseMetadata converts OpenStack metadata to platform network configuration.

Jump to

Keyboard shortcuts

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