Documentation
¶
Overview ¶
+k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +k8s:openapi-gen=true
Index ¶
- Constants
- Variables
- func RegisterDefaults(scheme *runtime.Scheme) error
- func SetDefaults_Image(obj *Image)
- func SetDefaults_Kernel(obj *Kernel)
- func SetDefaults_OCIImageClaim(obj *OCIImageClaim)
- func SetDefaults_PoolSpec(obj *PoolSpec)
- func SetDefaults_VM(obj *VM)
- func SetDefaults_VMKernelSpec(obj *VMKernelSpec)
- func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec)
- func SetDefaults_VMSpec(obj *VMSpec)
- func SetDefaults_VMStatus(obj *VMStatus)
- func SetObjectDefaults_Image(in *Image)
- func SetObjectDefaults_Kernel(in *Kernel)
- func SetObjectDefaults_Pool(in *Pool)
- func SetObjectDefaults_VM(in *VM)
- func ValidateNetworkMode(mode NetworkMode) error
- type FileMapping
- type Image
- type ImageSourceType
- type ImageSpec
- type ImageStatus
- type Kernel
- type KernelSpec
- type KernelStatus
- type NetworkMode
- type OCIImageClaim
- type OCIImageSource
- type Pool
- type PoolDevice
- type PoolDeviceType
- type PoolSpec
- type PoolStatus
- type SSH
- type VM
- type VMImageSpec
- type VMKernelSpec
- type VMNetworkSpec
- type VMSpec
- type VMState
- type VMStatus
Constants ¶
const ( // GroupName is the group name use in this package GroupName = "ignite.weave.works" // VMKind returns the kind for the VM API type VMKind = "VM" // KernelKind returns the kind for the Kernel API type KernelKind = "Kernel" // PoolKind returns the kind for the Pool API type PoolKind = "Pool" // ImageKind returns the kind for the Image API type ImageKind = "Image" )
Variables ¶
var ( // SchemeBuilder the schema builder SchemeBuilder = runtime.NewSchemeBuilder( addKnownTypes, addDefaultingFuncs, ) AddToScheme = localSchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{ Group: GroupName, Version: "v1alpha1", }
SchemeGroupVersion is group version used to register these objects
Functions ¶
func RegisterDefaults ¶
RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.
func SetDefaults_Image ¶
func SetDefaults_Image(obj *Image)
func SetDefaults_Kernel ¶
func SetDefaults_Kernel(obj *Kernel)
func SetDefaults_OCIImageClaim ¶
func SetDefaults_OCIImageClaim(obj *OCIImageClaim)
func SetDefaults_PoolSpec ¶
func SetDefaults_PoolSpec(obj *PoolSpec)
func SetDefaults_VM ¶
func SetDefaults_VM(obj *VM)
TODO: Temporary hacks to populate TypeMeta until we get the generator working
func SetDefaults_VMKernelSpec ¶
func SetDefaults_VMKernelSpec(obj *VMKernelSpec)
func SetDefaults_VMNetworkSpec ¶
func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec)
func SetDefaults_VMSpec ¶
func SetDefaults_VMSpec(obj *VMSpec)
func SetDefaults_VMStatus ¶
func SetDefaults_VMStatus(obj *VMStatus)
func SetObjectDefaults_Image ¶
func SetObjectDefaults_Image(in *Image)
func SetObjectDefaults_Kernel ¶
func SetObjectDefaults_Kernel(in *Kernel)
func SetObjectDefaults_Pool ¶
func SetObjectDefaults_Pool(in *Pool)
func SetObjectDefaults_VM ¶
func SetObjectDefaults_VM(in *VM)
func ValidateNetworkMode ¶
func ValidateNetworkMode(mode NetworkMode) error
ValidateNetworkMode validates the network mode TODO: This should move into a dedicated validation package
Types ¶
type FileMapping ¶
FileMapping defines mappings between files on the host and VM
func (*FileMapping) DeepCopy ¶
func (in *FileMapping) DeepCopy() *FileMapping
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileMapping.
func (*FileMapping) DeepCopyInto ¶
func (in *FileMapping) DeepCopyInto(out *FileMapping)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Image ¶
type Image struct { meta.TypeMeta `json:",inline"` // meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID // Name is available at the .metadata.name JSON path // ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string) meta.ObjectMeta `json:"metadata"` Spec ImageSpec `json:"spec"` Status ImageStatus `json:"status"` }
Image represents a cached OCI image ready to be used with Ignite +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Image) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image.
func (*Image) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Image) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ImageSourceType ¶
type ImageSourceType string
ImageSourceType is an enum of different supported Image Source Types
const ( // ImageSourceTypeDocker defines that the image is imported from Docker ImageSourceTypeDocker ImageSourceType = "Docker" )
type ImageSpec ¶
type ImageSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
ImageSpec declares what the image contains
func (*ImageSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.
func (*ImageSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ImageStatus ¶
type ImageStatus struct { // OCISource contains the information about how this OCI image was imported OCISource OCIImageSource `json:"ociSource"` }
ImageStatus defines the status of the image
func (*ImageStatus) DeepCopy ¶
func (in *ImageStatus) DeepCopy() *ImageStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageStatus.
func (*ImageStatus) DeepCopyInto ¶
func (in *ImageStatus) DeepCopyInto(out *ImageStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Kernel ¶
type Kernel struct { meta.TypeMeta `json:",inline"` // meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID // Name is available at the .metadata.name JSON path // ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string) meta.ObjectMeta `json:"metadata"` Spec KernelSpec `json:"spec"` Status KernelStatus `json:"status"` }
Kernel is a serializable object that caches information about imported kernels This file is stored in /var/lib/firecracker/kernels/{oci-image-digest}/metadata.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Kernel) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kernel.
func (*Kernel) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Kernel) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KernelSpec ¶
type KernelSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
KernelSpec describes the properties of a kernel
func (*KernelSpec) DeepCopy ¶
func (in *KernelSpec) DeepCopy() *KernelSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelSpec.
func (*KernelSpec) DeepCopyInto ¶
func (in *KernelSpec) DeepCopyInto(out *KernelSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KernelStatus ¶
type KernelStatus struct { Version string `json:"version"` OCISource OCIImageSource `json:"ociSource"` }
KernelStatus describes the status of a kernel
func (*KernelStatus) DeepCopy ¶
func (in *KernelStatus) DeepCopy() *KernelStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelStatus.
func (*KernelStatus) DeepCopyInto ¶
func (in *KernelStatus) DeepCopyInto(out *KernelStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NetworkMode ¶
type NetworkMode string
NetworkMode defines different states a VM can be in
const ( // NetworkModeCNI specifies the network mode where CNI is used NetworkModeCNI NetworkMode = "cni" // NetworkModeDockerBridge specifies the default docker bridge network is used NetworkModeDockerBridge NetworkMode = "docker-bridge" )
func GetNetworkModes ¶
func GetNetworkModes() []NetworkMode
GetNetworkModes gets the list of available network modes
func (NetworkMode) String ¶
func (nm NetworkMode) String() string
type OCIImageClaim ¶
type OCIImageClaim struct { // Type defines how the image should be imported Type ImageSourceType `json:"type"` // Ref defines the reference to use when talking to the backend. // This is most commonly the image name, followed by a tag. // Other supported ways are $registry/$user/$image@sha256:$digest // This ref is also used as ObjectMeta.Name for kinds Images and Kernels Ref meta.OCIImageRef `json:"ref"` }
OCIImageClaim defines a claim for importing an OCI image
func (*OCIImageClaim) DeepCopy ¶
func (in *OCIImageClaim) DeepCopy() *OCIImageClaim
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCIImageClaim.
func (*OCIImageClaim) DeepCopyInto ¶
func (in *OCIImageClaim) DeepCopyInto(out *OCIImageClaim)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OCIImageSource ¶
type OCIImageSource struct { // ID defines the source's ID (e.g. the Docker image ID) ID string `json:"id"` // Size defines the size of the source in bytes Size meta.Size `json:"size"` // RepoDigests defines the image name as it was when pulled // from a repository, and the digest of the image // The format is $registry/$user/$image@sha256:$digest // This field is unpopulated if the image used as the source // has never been pushed to or pulled from a registry RepoDigests []string `json:"repoDigests,omitempty"` }
OCIImageSource specifies how the OCI image was imported. It is the status variant of OCIImageClaim
func (*OCIImageSource) DeepCopy ¶
func (in *OCIImageSource) DeepCopy() *OCIImageSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCIImageSource.
func (*OCIImageSource) DeepCopyInto ¶
func (in *OCIImageSource) DeepCopyInto(out *OCIImageSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Pool ¶
type Pool struct { meta.TypeMeta `json:",inline"` Spec PoolSpec `json:"spec"` Status PoolStatus `json:"status"` }
Pool defines device mapper pool database This file is managed by the snapshotter part of Ignite, and the file (existing as a singleton) is present at /var/lib/firecracker/snapshotter/pool.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Pool) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool.
func (*Pool) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Pool) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PoolDevice ¶
type PoolDevice struct { Size meta.Size `json:"size"` Parent meta.DMID `json:"parent"` // Type specifies the type of the contents of the device Type PoolDeviceType `json:"type"` // MetadataPath points to the JSON/YAML file with metadata about this device // This is most often of the format /var/lib/firecracker/{type}/{id}/metadata.json MetadataPath string `json:"metadataPath"` }
PoolDevice defines one device in the pool
func (*PoolDevice) DeepCopy ¶
func (in *PoolDevice) DeepCopy() *PoolDevice
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolDevice.
func (*PoolDevice) DeepCopyInto ¶
func (in *PoolDevice) DeepCopyInto(out *PoolDevice)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolDeviceType ¶
type PoolDeviceType string
const ( PoolDeviceTypeImage PoolDeviceType = "Image" PoolDeviceTypeResize PoolDeviceType = "Resize" PoolDeviceTypeKernel PoolDeviceType = "Kernel" PoolDeviceTypeVM PoolDeviceType = "VM" )
type PoolSpec ¶
type PoolSpec struct { // MetadataSize specifies the size of the pool's metadata MetadataSize meta.Size `json:"metadataSize"` // DataSize specifies the size of the pool's data DataSize meta.Size `json:"dataSize"` // AllocationSize specifies the smallest size that can be allocated at a time AllocationSize meta.Size `json:"allocationSize"` // MetadataPath points to the file where device mapper stores all metadata information // Defaults to constants.SNAPSHOTTER_METADATA_PATH MetadataPath string `json:"metadataPath"` // DataPath points to the backing physical device or sparse file (to be loop mounted) for the pool // Defaults to constants.SNAPSHOTTER_DATA_PATH DataPath string `json:"dataPath"` }
PoolSpec defines the Pool's specification
func (*PoolSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolSpec.
func (*PoolSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolStatus ¶
type PoolStatus struct { // The Devices array needs to contain pointers to accommodate "holes" in the mapping // Where devices have been deleted, the pointer is nil Devices []*PoolDevice `json:"devices"` }
PoolStatus defines the Pool's current status
func (*PoolStatus) DeepCopy ¶
func (in *PoolStatus) DeepCopy() *PoolStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolStatus.
func (*PoolStatus) DeepCopyInto ¶
func (in *PoolStatus) DeepCopyInto(out *PoolStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SSH ¶
SSH specifies different ways to connect via SSH to the VM SSH uses a custom marshaller/unmarshaller. If generate is true, it marshals to true (a JSON bool). If PublicKey is set, it marshals to that string.
func (*SSH) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSH.
func (*SSH) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SSH) MarshalJSON ¶
func (*SSH) UnmarshalJSON ¶
type VM ¶
type VM struct { meta.TypeMeta `json:",inline"` // meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID // Name is available at the .metadata.name JSON path // ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string) meta.ObjectMeta `json:"metadata"` Spec VMSpec `json:"spec"` Status VMStatus `json:"status"` }
VM represents a virtual machine run by Firecracker These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*VM) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VM.
func (*VM) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VM) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type VMImageSpec ¶
type VMImageSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
func (*VMImageSpec) DeepCopy ¶
func (in *VMImageSpec) DeepCopy() *VMImageSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMImageSpec.
func (*VMImageSpec) DeepCopyInto ¶
func (in *VMImageSpec) DeepCopyInto(out *VMImageSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VMKernelSpec ¶
type VMKernelSpec struct { OCIClaim OCIImageClaim `json:"ociClaim"` CmdLine string `json:"cmdLine,omitempty"` }
func (*VMKernelSpec) DeepCopy ¶
func (in *VMKernelSpec) DeepCopy() *VMKernelSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMKernelSpec.
func (*VMKernelSpec) DeepCopyInto ¶
func (in *VMKernelSpec) DeepCopyInto(out *VMKernelSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VMNetworkSpec ¶
type VMNetworkSpec struct { Mode NetworkMode `json:"mode"` Ports meta.PortMappings `json:"ports,omitempty"` }
func (*VMNetworkSpec) DeepCopy ¶
func (in *VMNetworkSpec) DeepCopy() *VMNetworkSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMNetworkSpec.
func (*VMNetworkSpec) DeepCopyInto ¶
func (in *VMNetworkSpec) DeepCopyInto(out *VMNetworkSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VMSpec ¶
type VMSpec struct { Image VMImageSpec `json:"image"` Kernel VMKernelSpec `json:"kernel"` CPUs uint64 `json:"cpus"` Memory meta.Size `json:"memory"` DiskSize meta.Size `json:"diskSize"` Network VMNetworkSpec `json:"network"` // This will be done at either "ignite start" or "ignite create" time // TODO: We might revisit this later CopyFiles []FileMapping `json:"copyFiles,omitempty"` // SSH specifies how the SSH setup should be done // nil here means "don't do anything special" // If SSH.Generate is set, Ignite will generate a new SSH key and copy it in to authorized_keys in the VM // Specifying a path in SSH.Generate means "use this public key" // If SSH.PublicKey is set, this struct will marshal as a string using that path // If SSH.Generate is set, this struct will marshal as a bool => true SSH *SSH `json:"ssh,omitempty"` }
VMSpec describes the configuration of a VM
func (*VMSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMSpec.
func (*VMSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VMStatus ¶
type VMStatus struct { State VMState `json:"state"` IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"` Image OCIImageSource `json:"image"` Kernel OCIImageSource `json:"kernel"` }
VMStatus defines the status of a VM
func (*VMStatus) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMStatus.
func (*VMStatus) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.