metadata

package
v0.0.0-...-5b8b77a Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataTypeBaseOS = Type("baseos")
	MetadataTypeRootfs = Type("rootfs")
	MetadataTypeRun    = Type("run")
)

Metadata types.

Variables

This section is empty.

Functions

This section is empty.

Types

type MDBaseOS

type MDBaseOS struct {
	CreatedAtUTC int64             `json:"CreatedAtUTC" mapstructure:"CreatedAtUTC"`
	Image        MDImage           `json:"Image" mapstructure:"Image"`
	Labels       map[string]string `json:"Labels" mapstructure:"Labels"`
	Type         Type              `json:"Type" mapstructure:"Type"`
}

MDBaseOS is the base OS metadata.

type MDImage

type MDImage struct {
	Org     string `json:"Org" mapstructure:"Org"`
	Image   string `json:"Image" mapstructure:"Image"`
	Version string `json:"Version" mapstructure:"Version"`
}

MDImage is the image.

type MDNetIPConfiguration

type MDNetIPConfiguration struct {
	Gateway     string   `json:"Gateway" mapstructure:"Gateway"`
	IfName      string   `json:"IfName" mapstructure:"IfName"`
	IP          string   `json:"IP" mapstructure:"IP"`
	IPAddr      string   `json:"IPAddr" mapstructure:"IPAddr"`
	IPMask      string   `json:"IPMask" mapstructure:"IPMask"`
	IPNet       string   `json:"IPNet" mapstructure:"IPNet"`
	Nameservers []string `json:"NameServers" mapstructure:"NameServers"`
}

MDNetIPConfiguration is the IP configuration of a running VMM.

type MDNetStaticConfiguration

type MDNetStaticConfiguration struct {
	MacAddress string `json:"MacAddress" mapstructure:"MacAddress"`
	// HostDevName is the name of the tap device the VM will use
	HostDeviceName string `json:"HostDeviceName" mapstructure:"HostDeviceName"`
	// IPConfiguration (optional) allows a static IP, gateway and up to 2 DNS nameservers
	// to be automatically configured within the VM upon startup.
	IPConfiguration *MDNetIPConfiguration `json:"IPConfiguration" mapstructure:"IPConfiguration"`
}

MDNetStaticConfiguration is the static network configuration of a running VMM.

type MDNetworkInterafce

type MDNetworkInterafce struct {
	AllowMMDS           bool                      `json:"AllowMMDS" mapstructure:"AllowMMDS"`
	InRateLimiter       *models.RateLimiter       `json:"InRateLimiter" mapstructure:"InRateLimiter"`
	OutRateLimiter      *models.RateLimiter       `json:"OutRateLimiter" mapstructure:"OutRateLimiter"`
	StaticConfiguration *MDNetStaticConfiguration `json:"StaticConfiguration" mapstructure:"StaticConfiguration"`
}

MDNetworkInterafce is network interface configuration of a running VMM.

func FcNetworkInterfacesToMetadata

func FcNetworkInterfacesToMetadata(nifs firecracker.NetworkInterfaces) []MDNetworkInterafce

FcNetworkInterfacesToMetadata converts firecracker network interfaces to the metadata network interfaces.

type MDRootfs

type MDRootfs struct {
	BuildConfig    MDRootfsConfig                 `json:"BuildConfig" mapstructure:"BuildConfig"`
	CreatedAtUTC   int64                          `json:"CreatedAtUTC" mapstructure:"CreatedAtUTC"`
	EntrypointInfo *mmds.MMDSRootfsEntrypointInfo `json:"EntrypointInfo" mapstructure:"EntrypointInfo"`
	Image          MDImage                        `json:"Image" mapstructure:"Image"`
	Labels         map[string]string              `json:"Labels" mapstructure:"Labels"`
	Parent         interface{}                    `json:"Parent" mapstructure:"Parent"`
	Ports          []string                       `json:"Ports" mapstructure:"Ports"`
	Tag            string                         `json:"Tag" mapstructure:"Tag"`
	Type           Type                           `json:"Type" mapstructure:"Type"`
	Volumes        []string                       `json:"Volumes" mapstructure:"Volumes"`
}

MDRootfs represents a metadata of the rootfs.

func MDRootfsFromInterface

func MDRootfsFromInterface(input interface{}) (*MDRootfs, error)

MDRootfsFromInterface unwraps an interface{} as *MDRootfs.

type MDRootfsConfig

type MDRootfsConfig struct {
	BuildArgs         map[string]string `json:"BuildArgs" mapstructure:"BuildArgs"`
	Dockerfile        string            `json:"Dockerfile" mapstructure:"Dockerfile"`
	DockerImage       string            `json:"DockerImage" mapstructure:"DockerImage"`
	DockerImageBase   string            `json:"DockerImageBase" mapstructure:"DockerImageBase"`
	PreBuildCommands  []string          `json:"PreBuildCommands" mapstructure:"PreBuildCommands"`
	PostBuildCommands []string          `json:"PostBuildCommands" mapstructure:"PostBuildCommands"`
}

MDRootfsConfig represents the rootfs build configuration.

type MDRun

type MDRun struct {
	Bootstrap         *mmds.MMDSBootstrap  `json:"Bootstrap,omitempty" mapstructure:"Bootstrap,omitempty"`
	CNI               MDRunCNI             `json:"CNI" mapstructure:"CNI"`
	Configs           MDRunConfigs         `json:"Configs" mapstructure:"Configs"`
	Drives            []models.Drive       `json:"Drivers" mapstructure:"Drives"`
	NetworkInterfaces []MDNetworkInterafce `json:"NetworkInterfaces" mapstructure:"NetworkInterfaces"`
	PID               pid.RunningVMMPID    `json:"Pid" mapstructure:"Pid"`
	Rootfs            *MDRootfs            `json:"Rootfs" mapstructure:"Rootfs"`
	RunCache          string               `json:"RunCache" mapstructure:"RunCache"`
	StartedAtUTC      int64                `json:"StartedAtUTC" mapstructure:"StartedAtUTC"`
	VMMID             string               `json:"VMMID" mapstructure:"VMMID"`
	Type              Type                 `json:"Type" mapstructure:"Type"`
}

MDRun contains the runtime information about a VMM.

func (*MDRun) AsMMDS

func (r *MDRun) AsMMDS() (interface{}, error)

AsMMDS converts the run metadata to MMDS metadata.

type MDRunCNI

type MDRunCNI struct {
	VethName string `json:"VethName" mapstructure:"VethName"`
	NetName  string `json:"NetName" mapstructure:"NetName"`
	NetNS    string `json:"NetNS" mapstructure:"NetNS"`
}

MDRunCNI represents the CNI metadata of a running VMM. This metadata is stored in the VMM run cache directory.

type MDRunConfigs

type MDRunConfigs struct {
	CNI       *configs.CNIConfig                `json:"CNI" mapstructure:"CNI"`
	Jailer    *configs.JailingFirecrackerConfig `json:"Jailer" mapstructure:"Jailer"`
	Machine   *configs.MachineConfig            `json:"Machine" mapstructure:"Machine"`
	RunConfig *configs.RunCommandConfig         `json:"RunConfig" mapstructure:"RunConfig"`
}

MDRunConfigs contains the configuration of the running VMM.

type Type

type Type = string

Type is the type of the metadata entry stored in a file.

Jump to

Keyboard shortcuts

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