openstack

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

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"
	// OpenstackHostnameEndpoint is the local Openstack endpoint for the hostname.
	OpenstackHostnameEndpoint = "http://169.254.169.254/latest/meta-data/hostname"
	// 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 added in v0.14.0

type MetadataConfig struct {
	Hostname string `json:"hostname,omitempty"`
}

MetadataConfig holds meta info.

type NetworkConfig added in v0.14.0

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"`
	} `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) (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 added in v1.0.0

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

NetworkConfiguration implements the runtime.Platform interface.

func (*Openstack) ParseMetadata added in v1.0.0

func (o *Openstack) ParseMetadata(unmarshalledMetadataConfig *MetadataConfig, unmarshalledNetworkConfig *NetworkConfig, hostname string, extIPs []netaddr.IP) (*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