From 28973b315dedffb57c6099daa90346addd7f0f7b Mon Sep 17 00:00:00 2001 From: Sunny Date: Sat, 17 Apr 2021 22:33:14 +0530 Subject: [PATCH] Add v1alpha4 API This adds v1alpha4 API based on v1alpha3 API. This does not introduce any change to the API yet. Changes in API for the upcoming features will be added to v1alpha4 API. --- Makefile | 2 +- cmd/ignite/cmd/vmcmd/ps.go | 2 +- .../output/apply-vm-config-empty.json | 2 +- .../testdata/output/apply-vm-config-json.json | 2 +- .../testdata/output/apply-vm-config-yaml.json | 2 +- .../run/testdata/output/inspect-json.txt | 2 +- .../run/testdata/output/inspect-yaml.txt | 2 +- docs/api/ignite_v1alpha4.md | 550 +++++++++ docs/cli/ignite/ignite_ps.md | 2 +- docs/cli/ignite/ignite_vm_ps.md | 2 +- e2e/config_test.go | 16 +- e2e/gitops_test.go | 2 +- pkg/apis/ignite/scheme/scheme.go | 4 +- pkg/apis/ignite/v1alpha4/defaults.go | 96 ++ pkg/apis/ignite/v1alpha4/doc.go | 5 + pkg/apis/ignite/v1alpha4/json.go | 50 + pkg/apis/ignite/v1alpha4/register.go | 40 + pkg/apis/ignite/v1alpha4/types.go | 266 +++++ .../v1alpha4/zz_generated.conversion.go | 1039 +++++++++++++++++ .../ignite/v1alpha4/zz_generated.deepcopy.go | 618 ++++++++++ .../ignite/v1alpha4/zz_generated.defaults.go | 37 + pkg/openapi/openapi_generated.go | 968 +++++++++++++++ pkg/openapi/violations.txt | 5 + 23 files changed, 3695 insertions(+), 19 deletions(-) create mode 100644 docs/api/ignite_v1alpha4.md create mode 100644 pkg/apis/ignite/v1alpha4/defaults.go create mode 100644 pkg/apis/ignite/v1alpha4/doc.go create mode 100644 pkg/apis/ignite/v1alpha4/json.go create mode 100644 pkg/apis/ignite/v1alpha4/register.go create mode 100644 pkg/apis/ignite/v1alpha4/types.go create mode 100644 pkg/apis/ignite/v1alpha4/zz_generated.conversion.go create mode 100644 pkg/apis/ignite/v1alpha4/zz_generated.deepcopy.go create mode 100644 pkg/apis/ignite/v1alpha4/zz_generated.defaults.go diff --git a/Makefile b/Makefile index e11b9dbc3..ed512eb07 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ IMAGE_TAG:=$(shell IGNITE_GIT_VERSION=$(GIT_VERSION) DOCKER_USER=$(DOCKER_USER) IS_DIRTY:=$(shell echo ${GIT_VERSION} | grep -c dirty) PROJECT = github.com/weaveworks/ignite APIS_DIR = ${PROJECT}/pkg/apis -API_DIRS = ${APIS_DIR}/ignite,${APIS_DIR}/ignite/v1alpha2,${APIS_DIR}/ignite/v1alpha3,${APIS_DIR}/meta/v1alpha1 +API_DIRS = ${APIS_DIR}/ignite,${APIS_DIR}/ignite/v1alpha2,${APIS_DIR}/ignite/v1alpha3,${APIS_DIR}/ignite/v1alpha4,${APIS_DIR}/meta/v1alpha1 CACHE_DIR = $(shell pwd)/bin/cache # Specifies if this is a CI build or not; if it is, it will save the docker image created to bin/$(GOARCH)/image.tar IS_CI_BUILD ?= 0 diff --git a/cmd/ignite/cmd/vmcmd/ps.go b/cmd/ignite/cmd/vmcmd/ps.go index 798cfb1b8..45954032d 100644 --- a/cmd/ignite/cmd/vmcmd/ps.go +++ b/cmd/ignite/cmd/vmcmd/ps.go @@ -23,7 +23,7 @@ func NewCmdPs(out io.Writer) *cobra.Command { also list VMs that are not currently running. Using the -f (--filter) flag, you can give conditions VMs should fullfilled to be displayed. You can filter on all the underlying fields of the VM struct, see the documentation: - https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha3#VM. + https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha4#VM. Different operators can be used: - "=" and "==" for the equal diff --git a/cmd/ignite/run/testdata/output/apply-vm-config-empty.json b/cmd/ignite/run/testdata/output/apply-vm-config-empty.json index fa8cefaee..5161ec219 100644 --- a/cmd/ignite/run/testdata/output/apply-vm-config-empty.json +++ b/cmd/ignite/run/testdata/output/apply-vm-config-empty.json @@ -1,6 +1,6 @@ { "kind": "VM", - "apiVersion": "ignite.weave.works/v1alpha3", + "apiVersion": "ignite.weave.works/v1alpha4", "metadata": { "name": "", "created": "2000-01-01T01:00:00Z" diff --git a/cmd/ignite/run/testdata/output/apply-vm-config-json.json b/cmd/ignite/run/testdata/output/apply-vm-config-json.json index 22a4799d6..c8065772d 100644 --- a/cmd/ignite/run/testdata/output/apply-vm-config-json.json +++ b/cmd/ignite/run/testdata/output/apply-vm-config-json.json @@ -1,6 +1,6 @@ { "kind": "VM", - "apiVersion": "ignite.weave.works/v1alpha3", + "apiVersion": "ignite.weave.works/v1alpha4", "metadata": { "name": "", "created": "2000-01-01T01:00:00Z" diff --git a/cmd/ignite/run/testdata/output/apply-vm-config-yaml.json b/cmd/ignite/run/testdata/output/apply-vm-config-yaml.json index ac1e37fd8..10c8f41ba 100644 --- a/cmd/ignite/run/testdata/output/apply-vm-config-yaml.json +++ b/cmd/ignite/run/testdata/output/apply-vm-config-yaml.json @@ -1,6 +1,6 @@ { "kind": "VM", - "apiVersion": "ignite.weave.works/v1alpha3", + "apiVersion": "ignite.weave.works/v1alpha4", "metadata": { "name": "", "created": "2000-01-01T01:00:00Z" diff --git a/cmd/ignite/run/testdata/output/inspect-json.txt b/cmd/ignite/run/testdata/output/inspect-json.txt index eb7a94245..5b41ae698 100644 --- a/cmd/ignite/run/testdata/output/inspect-json.txt +++ b/cmd/ignite/run/testdata/output/inspect-json.txt @@ -1,6 +1,6 @@ { "kind": "VM", - "apiVersion": "ignite.weave.works/v1alpha3", + "apiVersion": "ignite.weave.works/v1alpha4", "metadata": { "name": "someVM", "uid": "1699b6ba255cde7f", diff --git a/cmd/ignite/run/testdata/output/inspect-yaml.txt b/cmd/ignite/run/testdata/output/inspect-yaml.txt index a1d42426a..88b139f18 100644 --- a/cmd/ignite/run/testdata/output/inspect-yaml.txt +++ b/cmd/ignite/run/testdata/output/inspect-yaml.txt @@ -1,4 +1,4 @@ -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: VM metadata: created: "2000-01-01T01:00:00Z" diff --git a/docs/api/ignite_v1alpha4.md b/docs/api/ignite_v1alpha4.md new file mode 100644 index 000000000..742e25885 --- /dev/null +++ b/docs/api/ignite_v1alpha4.md @@ -0,0 +1,550 @@ +# v1alpha4 + +`import "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4"` + + - [Overview](#pkg-overview) + - [Index](#pkg-index) + +## Overview + +\+k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta ++k8s:openapi-gen=true ++k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite + +## Index + + - [Constants](#pkg-constants) + - [Variables](#pkg-variables) + - [func SetDefaults\_ConfigurationSpec(obj + \*ConfigurationSpec)](#SetDefaults_ConfigurationSpec) + - [func SetDefaults\_PoolSpec(obj \*PoolSpec)](#SetDefaults_PoolSpec) + - [func SetDefaults\_VMKernelSpec(obj + \*VMKernelSpec)](#SetDefaults_VMKernelSpec) + - [func SetDefaults\_VMSandboxSpec(obj + \*VMSandboxSpec)](#SetDefaults_VMSandboxSpec) + - [func SetDefaults\_VMSpec(obj \*VMSpec)](#SetDefaults_VMSpec) + - [func SetDefaults\_VMStatus(obj \*VMStatus)](#SetDefaults_VMStatus) + - [type BlockDeviceVolume](#BlockDeviceVolume) + - [type Configuration](#Configuration) + - [type ConfigurationSpec](#ConfigurationSpec) + - [type FileMapping](#FileMapping) + - [type Image](#Image) + - [type ImageSpec](#ImageSpec) + - [type ImageStatus](#ImageStatus) + - [type Kernel](#Kernel) + - [type KernelSpec](#KernelSpec) + - [type KernelStatus](#KernelStatus) + - [type Network](#Network) + - [type OCIImageSource](#OCIImageSource) + - [type Pool](#Pool) + - [type PoolDevice](#PoolDevice) + - [type PoolDeviceType](#PoolDeviceType) + - [type PoolSpec](#PoolSpec) + - [type PoolStatus](#PoolStatus) + - [type Runtime](#Runtime) + - [type SSH](#SSH) + - [func (s \*SSH) MarshalJSON() (\[\]byte, + error)](#SSH.MarshalJSON) + - [func (s \*SSH) UnmarshalJSON(b \[\]byte) + error](#SSH.UnmarshalJSON) + - [type VM](#VM) + - [type VMImageSpec](#VMImageSpec) + - [type VMKernelSpec](#VMKernelSpec) + - [type VMNetworkSpec](#VMNetworkSpec) + - [type VMSandboxSpec](#VMSandboxSpec) + - [type VMSpec](#VMSpec) + - [type VMStatus](#VMStatus) + - [type VMStorageSpec](#VMStorageSpec) + - [type Volume](#Volume) + - [type VolumeMount](#VolumeMount) + +#### Package files + +[defaults.go](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go) +[doc.go](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/doc.go) +[json.go](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/json.go) +[register.go](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/register.go) +[types.go](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go) + +## Constants + +``` go +const ( + KindImage runtime.Kind = "Image" + KindKernel runtime.Kind = "Kernel" + KindVM runtime.Kind = "VM" +) +``` + +``` go +const ( + // GroupName is the group name use in this package + GroupName = "ignite.weave.works" +) +``` + +## Variables + +``` go +var ( + // SchemeBuilder the schema builder + SchemeBuilder = runtime.NewSchemeBuilder( + addKnownTypes, + addDefaultingFuncs, + ) + + AddToScheme = localSchemeBuilder.AddToScheme +) +``` + +``` go +var SchemeGroupVersion = schema.GroupVersion{ + Group: GroupName, + Version: "v1alpha4", +} +``` + +SchemeGroupVersion is group version used to register these objects + +## func [SetDefaults\_ConfigurationSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=1785:1843#L71) + +``` go +func SetDefaults_ConfigurationSpec(obj *ConfigurationSpec) +``` + +## func [SetDefaults\_PoolSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=424:464#L17) + +``` go +func SetDefaults_PoolSpec(obj *PoolSpec) +``` + +## func [SetDefaults\_VMKernelSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=1306:1354#L53) + +``` go +func SetDefaults_VMKernelSpec(obj *VMKernelSpec) +``` + +## func [SetDefaults\_VMSandboxSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=1584:1634#L64) + +``` go +func SetDefaults_VMSandboxSpec(obj *VMSandboxSpec) +``` + +## func [SetDefaults\_VMSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=990:1026#L39) + +``` go +func SetDefaults_VMSpec(obj *VMSpec) +``` + +## func [SetDefaults\_VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/defaults.go?s=2390:2430#L89) + +``` go +func SetDefaults_VMStatus(obj *VMStatus) +``` + +## type [BlockDeviceVolume](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7717:7777#L203) + +``` go +type BlockDeviceVolume struct { + Path string `json:"path"` +} +``` + +BlockDeviceVolume defines a block device on the host + +## type [Configuration](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=9275:9418#L253) + +``` go +type Configuration struct { + runtime.TypeMeta `json:",inline"` + runtime.ObjectMeta `json:"metadata"` + + Spec ConfigurationSpec `json:"spec"` +} +``` + +Configuration represents the ignite runtime configuration. ++k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +## type [ConfigurationSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=9475:9786#L261) + +``` go +type ConfigurationSpec struct { + Runtime igniteRuntime.Name `json:"runtime,omitempty"` + NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` + VMDefaults VMSpec `json:"vmDefaults,omitempty"` + IDPrefix string `json:"idPrefix,omitempty"` +} +``` + +ConfigurationSpec defines the ignite configuration. + +## type [FileMapping](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=8012:8107#L214) + +``` go +type FileMapping struct { + HostPath string `json:"hostPath"` + VMPath string `json:"vmPath"` +} +``` + +FileMapping defines mappings between files on the host and VM + +## type [Image](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=506:979#L18) + +``` go +type Image struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.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 + +## type [ImageSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=1027:1087#L30) + +``` go +type ImageSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} +``` + +ImageSpec declares what the image contains + +## type [ImageStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=1475:1624#L44) + +``` go +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 + +## type [Kernel](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=4009:4485#L108) + +``` go +type Kernel struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.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 + +## type [KernelSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=4538:4704#L120) + +``` go +type KernelSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} +``` + +KernelSpec describes the properties of a kernel + +## type [KernelStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=4755:4871#L127) + +``` go +type KernelStatus struct { + Version string `json:"version"` + OCISource OCIImageSource `json:"ociSource"` +} +``` + +KernelStatus describes the status of a kernel + +## type [Network](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=8608:8744#L235) + +``` go +type Network struct { + Plugin igniteNetwork.PluginName `json:"plugin"` + IPAddresses meta.IPAddresses `json:"ipAddresses"` +} +``` + +Network specifies the VM’s network information. + +## type [OCIImageSource](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=1194:1426#L36) + +``` go +type OCIImageSource struct { + // ID defines the source's content ID (e.g. the canonical OCI path or Docker image ID) + ID *meta.OCIContentID `json:"id"` + // Size defines the size of the source in bytes + Size meta.Size `json:"size"` +} +``` + +OCIImageSource specifies how the OCI image was imported. It is the +status variant of OCIImageClaim + +## type [Pool](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=1899:2085#L53) + +``` go +type Pool struct { + runtime.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 + +## type [PoolDevice](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=3376:3766#L95) + +``` go +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 + +## type [PoolDeviceType](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=3105:3131#L85) + +``` go +type PoolDeviceType string +``` + +``` go +const ( + PoolDeviceTypeImage PoolDeviceType = "Image" + PoolDeviceTypeResize PoolDeviceType = "Resize" + PoolDeviceTypeKernel PoolDeviceType = "Kernel" + PoolDeviceTypeVM PoolDeviceType = "VM" +) +``` + +## type [PoolSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=2132:2845#L63) + +``` go +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 + +## type [PoolStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=2895:3103#L79) + +``` go +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 + +## type [Runtime](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=8456:8555#L229) + +``` go +type Runtime struct { + ID string `json:"id"` + Name igniteRuntime.Name `json:"name"` +} +``` + +Runtime specifies the VM’s runtime information + +## type [SSH](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=8327:8404#L223) + +``` go +type SSH struct { + Generate bool `json:"-"` + PublicKey string `json:"-"` +} +``` + +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) [MarshalJSON](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/json.go?s=117:160#L9) + +``` go +func (s *SSH) MarshalJSON() ([]byte, error) +``` + +### func (\*SSH) [UnmarshalJSON](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/json.go?s=308:351#L21) + +``` go +func (s *SSH) UnmarshalJSON(b []byte) error +``` + +## type [VM](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=5073:5537#L135) + +``` go +type VM struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.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 + +## type [VMImageSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=6890:6952#L172) + +``` go +type VMImageSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} +``` + +## type [VMKernelSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=6954:7074#L176) + +``` go +type VMKernelSpec struct { + OCI meta.OCIImageRef `json:"oci"` + CmdLine string `json:"cmdLine,omitempty"` +} +``` + +## type [VMNetworkSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7203:7282#L186) + +``` go +type VMNetworkSpec struct { + Ports meta.PortMappings `json:"ports,omitempty"` +} +``` + +## type [VMSandboxSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7137:7201#L182) + +``` go +type VMSandboxSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} +``` + +VMSandboxSpec is the spec of the sandbox used for the VM. + +## type [VMSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=5585:6888#L147) + +``` go +type VMSpec struct { + Image VMImageSpec `json:"image"` + Sandbox VMSandboxSpec `json:"sandbox"` + Kernel VMKernelSpec `json:"kernel"` + CPUs uint64 `json:"cpus"` + Memory meta.Size `json:"memory"` + DiskSize meta.Size `json:"diskSize"` + // TODO: Implement working omitempty without pointers for the following entries + // Currently both will show in the JSON output as empty arrays. Making them + // pointers requires plenty of nil checks (as their contents are accessed directly) + // and is very risky for stability. APIMachinery potentially has a solution. + Network VMNetworkSpec `json:"network,omitempty"` + Storage VMStorageSpec `json:"storage,omitempty"` + // 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 + +## type [VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=8785:9140#L241) + +``` go +type VMStatus struct { + Running bool `json:"running"` + Runtime *Runtime `json:"runtime,omitempty"` + StartTime *runtime.Time `json:"startTime,omitempty"` + Network *Network `json:"network,omitempty"` + Image OCIImageSource `json:"image"` + Kernel OCIImageSource `json:"kernel"` + IDPrefix string `json:"idPrefix"` +} +``` + +VMStatus defines the status of a VM + +## type [VMStorageSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7343:7487#L191) + +``` go +type VMStorageSpec struct { + Volumes []Volume `json:"volumes,omitempty"` + VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` +} +``` + +VMStorageSpec defines the VM’s Volumes and VolumeMounts + +## type [Volume](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7528:7659#L197) + +``` go +type Volume struct { + Name string `json:"name"` + BlockDevice *BlockDeviceVolume `json:"blockDevice,omitempty"` +} +``` + +Volume defines named storage volume + +## type [VolumeMount](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha4/types.go?s=7849:7945#L208) + +``` go +type VolumeMount struct { + Name string `json:"name"` + MountPath string `json:"mountPath"` +} +``` + +VolumeMount defines the mount point for a named volume inside a VM + +----- + +Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/docs/cli/ignite/ignite_ps.md b/docs/cli/ignite/ignite_ps.md index 53fe92191..54a00b6ab 100644 --- a/docs/cli/ignite/ignite_ps.md +++ b/docs/cli/ignite/ignite_ps.md @@ -9,7 +9,7 @@ List all running VMs. By specifying the all flag (-a, --all), also list VMs that are not currently running. Using the -f (--filter) flag, you can give conditions VMs should fullfilled to be displayed. You can filter on all the underlying fields of the VM struct, see the documentation: -https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha3#VM. +https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha4#VM. Different operators can be used: - "=" and "==" for the equal diff --git a/docs/cli/ignite/ignite_vm_ps.md b/docs/cli/ignite/ignite_vm_ps.md index 420d08558..e9701f088 100644 --- a/docs/cli/ignite/ignite_vm_ps.md +++ b/docs/cli/ignite/ignite_vm_ps.md @@ -9,7 +9,7 @@ List all running VMs. By specifying the all flag (-a, --all), also list VMs that are not currently running. Using the -f (--filter) flag, you can give conditions VMs should fullfilled to be displayed. You can filter on all the underlying fields of the VM struct, see the documentation: -https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha3#VM. +https://ignite.readthedocs.io/en/stable/api/ignite_v1alpha4#VM. Different operators can be used: - "=" and "==" for the equal diff --git a/e2e/config_test.go b/e2e/config_test.go index 47c752018..76d8bdebe 100644 --- a/e2e/config_test.go +++ b/e2e/config_test.go @@ -32,7 +32,7 @@ func TestConfigFile(t *testing.T) { { name: "minimal valid config", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration `), wantVMProperties: fmt.Sprintf("'512.0 MB 1 4.0 GB weaveworks/ignite-ubuntu:latest weaveworks/ignite:dev weaveworks/ignite-kernel:%s '", constants.DEFAULT_KERNEL_IMAGE_TAG), @@ -40,7 +40,7 @@ kind: Configuration { name: "custom vm properties", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration metadata: name: test-config @@ -60,7 +60,7 @@ spec: { name: "runtime and network config", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration metadata: name: test-config @@ -73,7 +73,7 @@ spec: { name: "override properties", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration metadata: name: test-config @@ -89,7 +89,7 @@ spec: { name: "vm config", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration metadata: name: test-config @@ -100,7 +100,7 @@ spec: cpus: 2 `), vmConfig: []byte(` -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: VM spec: memory: "1GB" @@ -112,7 +112,7 @@ spec: { name: "vm config and flags", config: []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: Configuration metadata: name: test-config @@ -123,7 +123,7 @@ spec: cpus: 2 `), vmConfig: []byte(` -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: VM spec: memory: "1GB" diff --git a/e2e/gitops_test.go b/e2e/gitops_test.go index 0c5d8b9c3..446fd9d7e 100644 --- a/e2e/gitops_test.go +++ b/e2e/gitops_test.go @@ -65,7 +65,7 @@ func TestRunGitops(t *testing.T) { // Write a VM config file in the cloned repo, commit and push. vmConfig := []byte(`--- -apiVersion: ignite.weave.works/v1alpha3 +apiVersion: ignite.weave.works/v1alpha4 kind: VM metadata: name: my-vm diff --git a/pkg/apis/ignite/scheme/scheme.go b/pkg/apis/ignite/scheme/scheme.go index 6e04cce46..bbb3901a9 100644 --- a/pkg/apis/ignite/scheme/scheme.go +++ b/pkg/apis/ignite/scheme/scheme.go @@ -8,6 +8,7 @@ import ( "github.com/weaveworks/ignite/pkg/apis/ignite" "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2" "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3" + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4" "github.com/weaveworks/libgitops/pkg/serializer" ) @@ -32,5 +33,6 @@ func AddToScheme(scheme *runtime.Scheme) { utilruntime.Must(ignite.AddToScheme(Scheme)) utilruntime.Must(v1alpha2.AddToScheme(Scheme)) utilruntime.Must(v1alpha3.AddToScheme(Scheme)) - utilruntime.Must(scheme.SetVersionPriority(v1alpha3.SchemeGroupVersion)) + utilruntime.Must(v1alpha4.AddToScheme(Scheme)) + utilruntime.Must(scheme.SetVersionPriority(v1alpha4.SchemeGroupVersion)) } diff --git a/pkg/apis/ignite/v1alpha4/defaults.go b/pkg/apis/ignite/v1alpha4/defaults.go new file mode 100644 index 000000000..d08189dae --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/defaults.go @@ -0,0 +1,96 @@ +package v1alpha4 + +import ( + meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + "github.com/weaveworks/ignite/pkg/constants" + igniteNetwork "github.com/weaveworks/ignite/pkg/network" + igniteRuntime "github.com/weaveworks/ignite/pkg/runtime" + "github.com/weaveworks/ignite/pkg/version" + + "k8s.io/apimachinery/pkg/runtime" +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} + +func SetDefaults_PoolSpec(obj *PoolSpec) { + if obj.AllocationSize == meta.EmptySize { + obj.AllocationSize = meta.NewSizeFromSectors(constants.POOL_ALLOCATION_SIZE_SECTORS) + } + + if obj.DataSize == meta.EmptySize { + obj.AllocationSize = meta.NewSizeFromBytes(constants.POOL_DATA_SIZE_BYTES) + } + + if obj.MetadataSize == meta.EmptySize { + obj.AllocationSize = calcMetadataDevSize(obj) + } + + if len(obj.MetadataPath) == 0 { + obj.MetadataPath = constants.SNAPSHOTTER_METADATA_PATH + } + + if len(obj.DataPath) == 0 { + obj.DataPath = constants.SNAPSHOTTER_DATA_PATH + } +} + +func SetDefaults_VMSpec(obj *VMSpec) { + if obj.CPUs == 0 { + obj.CPUs = constants.VM_DEFAULT_CPUS + } + + if obj.Memory == meta.EmptySize { + obj.Memory = meta.NewSizeFromBytes(constants.VM_DEFAULT_MEMORY) + } + + if obj.DiskSize == meta.EmptySize { + obj.DiskSize = meta.NewSizeFromBytes(constants.VM_DEFAULT_SIZE) + } +} + +func SetDefaults_VMKernelSpec(obj *VMKernelSpec) { + // Default the kernel image if unset. + if obj.OCI.IsUnset() { + obj.OCI, _ = meta.NewOCIImageRef(version.GetIgnite().KernelImage.String()) + } + + if len(obj.CmdLine) == 0 { + obj.CmdLine = constants.VM_DEFAULT_KERNEL_ARGS + } +} + +func SetDefaults_VMSandboxSpec(obj *VMSandboxSpec) { + // Default the sandbox image if unset. + if obj.OCI.IsUnset() { + obj.OCI, _ = meta.NewOCIImageRef(version.GetIgnite().SandboxImage.String()) + } +} + +func SetDefaults_ConfigurationSpec(obj *ConfigurationSpec) { + // Default the runtime and network plugin if not set. + if obj.Runtime == "" { + obj.Runtime = igniteRuntime.RuntimeContainerd + } + if obj.NetworkPlugin == "" { + obj.NetworkPlugin = igniteNetwork.PluginCNI + } +} + +func calcMetadataDevSize(obj *PoolSpec) meta.Size { + // The minimum size is 2 MB and the maximum size is 16 GB + minSize := meta.NewSizeFromBytes(2 * constants.MB) + maxSize := meta.NewSizeFromBytes(16 * constants.GB) + + return meta.NewSizeFromBytes(48 * obj.DataSize.Bytes() / obj.AllocationSize.Bytes()).Min(maxSize).Max(minSize) +} + +func SetDefaults_VMStatus(obj *VMStatus) { + if obj.Runtime == nil { + obj.Runtime = &Runtime{} + } + if obj.Network == nil { + obj.Network = &Network{} + } +} diff --git a/pkg/apis/ignite/v1alpha4/doc.go b/pkg/apis/ignite/v1alpha4/doc.go new file mode 100644 index 000000000..19cf1b0ba --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true +// +k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite +package v1alpha4 diff --git a/pkg/apis/ignite/v1alpha4/json.go b/pkg/apis/ignite/v1alpha4/json.go new file mode 100644 index 000000000..752a7b0d6 --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/json.go @@ -0,0 +1,50 @@ +package v1alpha4 + +import ( + "encoding/json" +) + +// In this package custom marshal/unmarshal functions are registered + +func (s *SSH) MarshalJSON() ([]byte, error) { + if len(s.PublicKey) != 0 { + return json.Marshal(s.PublicKey) + } + + if s.Generate { + return json.Marshal(true) + } + + return []byte("{}"), nil +} + +func (s *SSH) UnmarshalJSON(b []byte) error { + var str string + if err := json.Unmarshal(b, &str); err == nil { + if str == "true" { + *s = SSH{ + Generate: true, + } + } else { + *s = SSH{ + PublicKey: str, + } + } + + return nil + } + + var boolVar bool + if err := json.Unmarshal(b, &boolVar); err == nil { + if boolVar { + *s = SSH{ + Generate: true, + } + + return nil + } + } + + // The user did not specify this field, just return + return nil +} diff --git a/pkg/apis/ignite/v1alpha4/register.go b/pkg/apis/ignite/v1alpha4/register.go new file mode 100644 index 000000000..cb99c9172 --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/register.go @@ -0,0 +1,40 @@ +package v1alpha4 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + // SchemeBuilder the schema builder + SchemeBuilder = runtime.NewSchemeBuilder( + addKnownTypes, + addDefaultingFuncs, + ) + + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +const ( + // GroupName is the group name use in this package + GroupName = "ignite.weave.works" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{ + Group: GroupName, + Version: "v1alpha4", +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &VM{}, + &Kernel{}, + &Pool{}, + &Image{}, + &Configuration{}, + ) + return nil +} diff --git a/pkg/apis/ignite/v1alpha4/types.go b/pkg/apis/ignite/v1alpha4/types.go new file mode 100644 index 000000000..f625a3c46 --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/types.go @@ -0,0 +1,266 @@ +package v1alpha4 + +import ( + meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + igniteNetwork "github.com/weaveworks/ignite/pkg/network" + igniteRuntime "github.com/weaveworks/ignite/pkg/runtime" + "github.com/weaveworks/libgitops/pkg/runtime" +) + +const ( + KindImage runtime.Kind = "Image" + KindKernel runtime.Kind = "Kernel" + KindVM runtime.Kind = "VM" +) + +// Image represents a cached OCI image ready to be used with Ignite +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type Image struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.ObjectMeta `json:"metadata"` + + Spec ImageSpec `json:"spec"` + Status ImageStatus `json:"status"` +} + +// ImageSpec declares what the image contains +type ImageSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} + +// OCIImageSource specifies how the OCI image was imported. +// It is the status variant of OCIImageClaim +type OCIImageSource struct { + // ID defines the source's content ID (e.g. the canonical OCI path or Docker image ID) + ID *meta.OCIContentID `json:"id"` + // Size defines the size of the source in bytes + Size meta.Size `json:"size"` +} + +// ImageStatus defines the status of the image +type ImageStatus struct { + // OCISource contains the information about how this OCI image was imported + OCISource OCIImageSource `json:"ociSource"` +} + +// 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 +type Pool struct { + runtime.TypeMeta `json:",inline"` + // Not needed (yet) + // runtime.ObjectMeta `json:"metadata"` + + Spec PoolSpec `json:"spec"` + Status PoolStatus `json:"status"` +} + +// PoolSpec defines the Pool's specification +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"` +} + +// PoolStatus defines the Pool's current status +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"` +} + +type PoolDeviceType string + +const ( + PoolDeviceTypeImage PoolDeviceType = "Image" + PoolDeviceTypeResize PoolDeviceType = "Resize" + PoolDeviceTypeKernel PoolDeviceType = "Kernel" + PoolDeviceTypeVM PoolDeviceType = "VM" +) + +// PoolDevice defines one device in the pool +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"` +} + +// 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 +type Kernel struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.ObjectMeta `json:"metadata"` + + Spec KernelSpec `json:"spec"` + Status KernelStatus `json:"status"` +} + +// KernelSpec describes the properties of a kernel +type KernelSpec struct { + OCI meta.OCIImageRef `json:"oci"` + // Optional future feature, support per-kernel specific default command lines + // DefaultCmdLine string +} + +// KernelStatus describes the status of a kernel +type KernelStatus struct { + Version string `json:"version"` + OCISource OCIImageSource `json:"ociSource"` +} + +// 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 +type VM struct { + runtime.TypeMeta `json:",inline"` + // runtime.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) + runtime.ObjectMeta `json:"metadata"` + + Spec VMSpec `json:"spec"` + Status VMStatus `json:"status"` +} + +// VMSpec describes the configuration of a VM +type VMSpec struct { + Image VMImageSpec `json:"image"` + Sandbox VMSandboxSpec `json:"sandbox"` + Kernel VMKernelSpec `json:"kernel"` + CPUs uint64 `json:"cpus"` + Memory meta.Size `json:"memory"` + DiskSize meta.Size `json:"diskSize"` + // TODO: Implement working omitempty without pointers for the following entries + // Currently both will show in the JSON output as empty arrays. Making them + // pointers requires plenty of nil checks (as their contents are accessed directly) + // and is very risky for stability. APIMachinery potentially has a solution. + Network VMNetworkSpec `json:"network,omitempty"` + Storage VMStorageSpec `json:"storage,omitempty"` + // 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"` +} + +type VMImageSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} + +type VMKernelSpec struct { + OCI meta.OCIImageRef `json:"oci"` + CmdLine string `json:"cmdLine,omitempty"` +} + +// VMSandboxSpec is the spec of the sandbox used for the VM. +type VMSandboxSpec struct { + OCI meta.OCIImageRef `json:"oci"` +} + +type VMNetworkSpec struct { + Ports meta.PortMappings `json:"ports,omitempty"` +} + +// VMStorageSpec defines the VM's Volumes and VolumeMounts +type VMStorageSpec struct { + Volumes []Volume `json:"volumes,omitempty"` + VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` +} + +// Volume defines named storage volume +type Volume struct { + Name string `json:"name"` + BlockDevice *BlockDeviceVolume `json:"blockDevice,omitempty"` +} + +// BlockDeviceVolume defines a block device on the host +type BlockDeviceVolume struct { + Path string `json:"path"` +} + +// VolumeMount defines the mount point for a named volume inside a VM +type VolumeMount struct { + Name string `json:"name"` + MountPath string `json:"mountPath"` +} + +// FileMapping defines mappings between files on the host and VM +type FileMapping struct { + HostPath string `json:"hostPath"` + VMPath string `json:"vmPath"` +} + +// 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. +type SSH struct { + Generate bool `json:"-"` + PublicKey string `json:"-"` +} + +// Runtime specifies the VM's runtime information +type Runtime struct { + ID string `json:"id"` + Name igniteRuntime.Name `json:"name"` +} + +// Network specifies the VM's network information. +type Network struct { + Plugin igniteNetwork.PluginName `json:"plugin"` + IPAddresses meta.IPAddresses `json:"ipAddresses"` +} + +// VMStatus defines the status of a VM +type VMStatus struct { + Running bool `json:"running"` + Runtime *Runtime `json:"runtime,omitempty"` + StartTime *runtime.Time `json:"startTime,omitempty"` + Network *Network `json:"network,omitempty"` + Image OCIImageSource `json:"image"` + Kernel OCIImageSource `json:"kernel"` + IDPrefix string `json:"idPrefix"` +} + +// Configuration represents the ignite runtime configuration. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type Configuration struct { + runtime.TypeMeta `json:",inline"` + runtime.ObjectMeta `json:"metadata"` + + Spec ConfigurationSpec `json:"spec"` +} + +// ConfigurationSpec defines the ignite configuration. +type ConfigurationSpec struct { + Runtime igniteRuntime.Name `json:"runtime,omitempty"` + NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` + VMDefaults VMSpec `json:"vmDefaults,omitempty"` + IDPrefix string `json:"idPrefix,omitempty"` +} diff --git a/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go new file mode 100644 index 000000000..f463c204c --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,1039 @@ +// +build !ignore_autogenerated + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + unsafe "unsafe" + + ignite "github.com/weaveworks/ignite/pkg/apis/ignite" + v1alpha1 "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + network "github.com/weaveworks/ignite/pkg/network" + pkgruntime "github.com/weaveworks/ignite/pkg/runtime" + libgitopspkgruntime "github.com/weaveworks/libgitops/pkg/runtime" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*BlockDeviceVolume)(nil), (*ignite.BlockDeviceVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume(a.(*BlockDeviceVolume), b.(*ignite.BlockDeviceVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.BlockDeviceVolume)(nil), (*BlockDeviceVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume(a.(*ignite.BlockDeviceVolume), b.(*BlockDeviceVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*ignite.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Configuration_To_ignite_Configuration(a.(*Configuration), b.(*ignite.Configuration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Configuration_To_v1alpha4_Configuration(a.(*ignite.Configuration), b.(*Configuration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ConfigurationSpec)(nil), (*ignite.ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(a.(*ConfigurationSpec), b.(*ignite.ConfigurationSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.ConfigurationSpec)(nil), (*ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(a.(*ignite.ConfigurationSpec), b.(*ConfigurationSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*FileMapping)(nil), (*ignite.FileMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_FileMapping_To_ignite_FileMapping(a.(*FileMapping), b.(*ignite.FileMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.FileMapping)(nil), (*FileMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_FileMapping_To_v1alpha4_FileMapping(a.(*ignite.FileMapping), b.(*FileMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Image)(nil), (*ignite.Image)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Image_To_ignite_Image(a.(*Image), b.(*ignite.Image), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Image)(nil), (*Image)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Image_To_v1alpha4_Image(a.(*ignite.Image), b.(*Image), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ImageSpec)(nil), (*ignite.ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ImageSpec_To_ignite_ImageSpec(a.(*ImageSpec), b.(*ignite.ImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.ImageSpec)(nil), (*ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_ImageSpec_To_v1alpha4_ImageSpec(a.(*ignite.ImageSpec), b.(*ImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ImageStatus)(nil), (*ignite.ImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ImageStatus_To_ignite_ImageStatus(a.(*ImageStatus), b.(*ignite.ImageStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.ImageStatus)(nil), (*ImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_ImageStatus_To_v1alpha4_ImageStatus(a.(*ignite.ImageStatus), b.(*ImageStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Kernel)(nil), (*ignite.Kernel)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Kernel_To_ignite_Kernel(a.(*Kernel), b.(*ignite.Kernel), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Kernel)(nil), (*Kernel)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Kernel_To_v1alpha4_Kernel(a.(*ignite.Kernel), b.(*Kernel), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*KernelSpec)(nil), (*ignite.KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_KernelSpec_To_ignite_KernelSpec(a.(*KernelSpec), b.(*ignite.KernelSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.KernelSpec)(nil), (*KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_KernelSpec_To_v1alpha4_KernelSpec(a.(*ignite.KernelSpec), b.(*KernelSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*KernelStatus)(nil), (*ignite.KernelStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_KernelStatus_To_ignite_KernelStatus(a.(*KernelStatus), b.(*ignite.KernelStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.KernelStatus)(nil), (*KernelStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_KernelStatus_To_v1alpha4_KernelStatus(a.(*ignite.KernelStatus), b.(*KernelStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Network)(nil), (*ignite.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Network_To_ignite_Network(a.(*Network), b.(*ignite.Network), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Network_To_v1alpha4_Network(a.(*ignite.Network), b.(*Network), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*OCIImageSource)(nil), (*ignite.OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(a.(*OCIImageSource), b.(*ignite.OCIImageSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.OCIImageSource)(nil), (*OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(a.(*ignite.OCIImageSource), b.(*OCIImageSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Pool)(nil), (*ignite.Pool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Pool_To_ignite_Pool(a.(*Pool), b.(*ignite.Pool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Pool)(nil), (*Pool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Pool_To_v1alpha4_Pool(a.(*ignite.Pool), b.(*Pool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PoolDevice)(nil), (*ignite.PoolDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_PoolDevice_To_ignite_PoolDevice(a.(*PoolDevice), b.(*ignite.PoolDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.PoolDevice)(nil), (*PoolDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_PoolDevice_To_v1alpha4_PoolDevice(a.(*ignite.PoolDevice), b.(*PoolDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PoolSpec)(nil), (*ignite.PoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_PoolSpec_To_ignite_PoolSpec(a.(*PoolSpec), b.(*ignite.PoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.PoolSpec)(nil), (*PoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_PoolSpec_To_v1alpha4_PoolSpec(a.(*ignite.PoolSpec), b.(*PoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PoolStatus)(nil), (*ignite.PoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_PoolStatus_To_ignite_PoolStatus(a.(*PoolStatus), b.(*ignite.PoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.PoolStatus)(nil), (*PoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_PoolStatus_To_v1alpha4_PoolStatus(a.(*ignite.PoolStatus), b.(*PoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Runtime)(nil), (*ignite.Runtime)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Runtime_To_ignite_Runtime(a.(*Runtime), b.(*ignite.Runtime), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Runtime)(nil), (*Runtime)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Runtime_To_v1alpha4_Runtime(a.(*ignite.Runtime), b.(*Runtime), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*SSH)(nil), (*ignite.SSH)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_SSH_To_ignite_SSH(a.(*SSH), b.(*ignite.SSH), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.SSH)(nil), (*SSH)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_SSH_To_v1alpha4_SSH(a.(*ignite.SSH), b.(*SSH), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VM)(nil), (*ignite.VM)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VM_To_ignite_VM(a.(*VM), b.(*ignite.VM), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VM)(nil), (*VM)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VM_To_v1alpha4_VM(a.(*ignite.VM), b.(*VM), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMImageSpec)(nil), (*ignite.VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(a.(*VMImageSpec), b.(*ignite.VMImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMImageSpec)(nil), (*VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(a.(*ignite.VMImageSpec), b.(*VMImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMKernelSpec)(nil), (*ignite.VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(a.(*VMKernelSpec), b.(*ignite.VMKernelSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMKernelSpec)(nil), (*VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(a.(*ignite.VMKernelSpec), b.(*VMKernelSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMNetworkSpec)(nil), (*ignite.VMNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(a.(*VMNetworkSpec), b.(*ignite.VMNetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMNetworkSpec)(nil), (*VMNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(a.(*ignite.VMNetworkSpec), b.(*VMNetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMSandboxSpec)(nil), (*ignite.VMSandboxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(a.(*VMSandboxSpec), b.(*ignite.VMSandboxSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMSandboxSpec)(nil), (*VMSandboxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(a.(*ignite.VMSandboxSpec), b.(*VMSandboxSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMSpec)(nil), (*ignite.VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMSpec_To_ignite_VMSpec(a.(*VMSpec), b.(*ignite.VMSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMSpec)(nil), (*VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMSpec_To_v1alpha4_VMSpec(a.(*ignite.VMSpec), b.(*VMSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMStatus)(nil), (*ignite.VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMStatus_To_ignite_VMStatus(a.(*VMStatus), b.(*ignite.VMStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMStatus)(nil), (*VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMStatus_To_v1alpha4_VMStatus(a.(*ignite.VMStatus), b.(*VMStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VMStorageSpec)(nil), (*ignite.VMStorageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(a.(*VMStorageSpec), b.(*ignite.VMStorageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VMStorageSpec)(nil), (*VMStorageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(a.(*ignite.VMStorageSpec), b.(*VMStorageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Volume)(nil), (*ignite.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Volume_To_ignite_Volume(a.(*Volume), b.(*ignite.Volume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_Volume_To_v1alpha4_Volume(a.(*ignite.Volume), b.(*Volume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VolumeMount)(nil), (*ignite.VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VolumeMount_To_ignite_VolumeMount(a.(*VolumeMount), b.(*ignite.VolumeMount), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ignite.VolumeMount)(nil), (*VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VolumeMount_To_v1alpha4_VolumeMount(a.(*ignite.VolumeMount), b.(*VolumeMount), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume(in *BlockDeviceVolume, out *ignite.BlockDeviceVolume, s conversion.Scope) error { + out.Path = in.Path + return nil +} + +// Convert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume is an autogenerated conversion function. +func Convert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume(in *BlockDeviceVolume, out *ignite.BlockDeviceVolume, s conversion.Scope) error { + return autoConvert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume(in, out, s) +} + +func autoConvert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume(in *ignite.BlockDeviceVolume, out *BlockDeviceVolume, s conversion.Scope) error { + out.Path = in.Path + return nil +} + +// Convert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume is an autogenerated conversion function. +func Convert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume(in *ignite.BlockDeviceVolume, out *BlockDeviceVolume, s conversion.Scope) error { + return autoConvert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume(in, out, s) +} + +func autoConvert_v1alpha4_Configuration_To_ignite_Configuration(in *Configuration, out *ignite.Configuration, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Configuration_To_ignite_Configuration is an autogenerated conversion function. +func Convert_v1alpha4_Configuration_To_ignite_Configuration(in *Configuration, out *ignite.Configuration, s conversion.Scope) error { + return autoConvert_v1alpha4_Configuration_To_ignite_Configuration(in, out, s) +} + +func autoConvert_ignite_Configuration_To_v1alpha4_Configuration(in *ignite.Configuration, out *Configuration, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_Configuration_To_v1alpha4_Configuration is an autogenerated conversion function. +func Convert_ignite_Configuration_To_v1alpha4_Configuration(in *ignite.Configuration, out *Configuration, s conversion.Scope) error { + return autoConvert_ignite_Configuration_To_v1alpha4_Configuration(in, out, s) +} + +func autoConvert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(in *ConfigurationSpec, out *ignite.ConfigurationSpec, s conversion.Scope) error { + out.Runtime = pkgruntime.Name(in.Runtime) + out.NetworkPlugin = network.PluginName(in.NetworkPlugin) + if err := Convert_v1alpha4_VMSpec_To_ignite_VMSpec(&in.VMDefaults, &out.VMDefaults, s); err != nil { + return err + } + out.IDPrefix = in.IDPrefix + return nil +} + +// Convert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec is an autogenerated conversion function. +func Convert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(in *ConfigurationSpec, out *ignite.ConfigurationSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(in, out, s) +} + +func autoConvert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(in *ignite.ConfigurationSpec, out *ConfigurationSpec, s conversion.Scope) error { + out.Runtime = pkgruntime.Name(in.Runtime) + out.NetworkPlugin = network.PluginName(in.NetworkPlugin) + if err := Convert_ignite_VMSpec_To_v1alpha4_VMSpec(&in.VMDefaults, &out.VMDefaults, s); err != nil { + return err + } + out.IDPrefix = in.IDPrefix + return nil +} + +// Convert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec is an autogenerated conversion function. +func Convert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(in *ignite.ConfigurationSpec, out *ConfigurationSpec, s conversion.Scope) error { + return autoConvert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(in, out, s) +} + +func autoConvert_v1alpha4_FileMapping_To_ignite_FileMapping(in *FileMapping, out *ignite.FileMapping, s conversion.Scope) error { + out.HostPath = in.HostPath + out.VMPath = in.VMPath + return nil +} + +// Convert_v1alpha4_FileMapping_To_ignite_FileMapping is an autogenerated conversion function. +func Convert_v1alpha4_FileMapping_To_ignite_FileMapping(in *FileMapping, out *ignite.FileMapping, s conversion.Scope) error { + return autoConvert_v1alpha4_FileMapping_To_ignite_FileMapping(in, out, s) +} + +func autoConvert_ignite_FileMapping_To_v1alpha4_FileMapping(in *ignite.FileMapping, out *FileMapping, s conversion.Scope) error { + out.HostPath = in.HostPath + out.VMPath = in.VMPath + return nil +} + +// Convert_ignite_FileMapping_To_v1alpha4_FileMapping is an autogenerated conversion function. +func Convert_ignite_FileMapping_To_v1alpha4_FileMapping(in *ignite.FileMapping, out *FileMapping, s conversion.Scope) error { + return autoConvert_ignite_FileMapping_To_v1alpha4_FileMapping(in, out, s) +} + +func autoConvert_v1alpha4_Image_To_ignite_Image(in *Image, out *ignite.Image, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_ImageSpec_To_ignite_ImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_ImageStatus_To_ignite_ImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Image_To_ignite_Image is an autogenerated conversion function. +func Convert_v1alpha4_Image_To_ignite_Image(in *Image, out *ignite.Image, s conversion.Scope) error { + return autoConvert_v1alpha4_Image_To_ignite_Image(in, out, s) +} + +func autoConvert_ignite_Image_To_v1alpha4_Image(in *ignite.Image, out *Image, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_ignite_ImageSpec_To_v1alpha4_ImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_ignite_ImageStatus_To_v1alpha4_ImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_Image_To_v1alpha4_Image is an autogenerated conversion function. +func Convert_ignite_Image_To_v1alpha4_Image(in *ignite.Image, out *Image, s conversion.Scope) error { + return autoConvert_ignite_Image_To_v1alpha4_Image(in, out, s) +} + +func autoConvert_v1alpha4_ImageSpec_To_ignite_ImageSpec(in *ImageSpec, out *ignite.ImageSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_v1alpha4_ImageSpec_To_ignite_ImageSpec is an autogenerated conversion function. +func Convert_v1alpha4_ImageSpec_To_ignite_ImageSpec(in *ImageSpec, out *ignite.ImageSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_ImageSpec_To_ignite_ImageSpec(in, out, s) +} + +func autoConvert_ignite_ImageSpec_To_v1alpha4_ImageSpec(in *ignite.ImageSpec, out *ImageSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_ignite_ImageSpec_To_v1alpha4_ImageSpec is an autogenerated conversion function. +func Convert_ignite_ImageSpec_To_v1alpha4_ImageSpec(in *ignite.ImageSpec, out *ImageSpec, s conversion.Scope) error { + return autoConvert_ignite_ImageSpec_To_v1alpha4_ImageSpec(in, out, s) +} + +func autoConvert_v1alpha4_ImageStatus_To_ignite_ImageStatus(in *ImageStatus, out *ignite.ImageStatus, s conversion.Scope) error { + if err := Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_ImageStatus_To_ignite_ImageStatus is an autogenerated conversion function. +func Convert_v1alpha4_ImageStatus_To_ignite_ImageStatus(in *ImageStatus, out *ignite.ImageStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_ImageStatus_To_ignite_ImageStatus(in, out, s) +} + +func autoConvert_ignite_ImageStatus_To_v1alpha4_ImageStatus(in *ignite.ImageStatus, out *ImageStatus, s conversion.Scope) error { + if err := Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_ImageStatus_To_v1alpha4_ImageStatus is an autogenerated conversion function. +func Convert_ignite_ImageStatus_To_v1alpha4_ImageStatus(in *ignite.ImageStatus, out *ImageStatus, s conversion.Scope) error { + return autoConvert_ignite_ImageStatus_To_v1alpha4_ImageStatus(in, out, s) +} + +func autoConvert_v1alpha4_Kernel_To_ignite_Kernel(in *Kernel, out *ignite.Kernel, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_KernelSpec_To_ignite_KernelSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_KernelStatus_To_ignite_KernelStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Kernel_To_ignite_Kernel is an autogenerated conversion function. +func Convert_v1alpha4_Kernel_To_ignite_Kernel(in *Kernel, out *ignite.Kernel, s conversion.Scope) error { + return autoConvert_v1alpha4_Kernel_To_ignite_Kernel(in, out, s) +} + +func autoConvert_ignite_Kernel_To_v1alpha4_Kernel(in *ignite.Kernel, out *Kernel, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_ignite_KernelSpec_To_v1alpha4_KernelSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_ignite_KernelStatus_To_v1alpha4_KernelStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_Kernel_To_v1alpha4_Kernel is an autogenerated conversion function. +func Convert_ignite_Kernel_To_v1alpha4_Kernel(in *ignite.Kernel, out *Kernel, s conversion.Scope) error { + return autoConvert_ignite_Kernel_To_v1alpha4_Kernel(in, out, s) +} + +func autoConvert_v1alpha4_KernelSpec_To_ignite_KernelSpec(in *KernelSpec, out *ignite.KernelSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_v1alpha4_KernelSpec_To_ignite_KernelSpec is an autogenerated conversion function. +func Convert_v1alpha4_KernelSpec_To_ignite_KernelSpec(in *KernelSpec, out *ignite.KernelSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_KernelSpec_To_ignite_KernelSpec(in, out, s) +} + +func autoConvert_ignite_KernelSpec_To_v1alpha4_KernelSpec(in *ignite.KernelSpec, out *KernelSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_ignite_KernelSpec_To_v1alpha4_KernelSpec is an autogenerated conversion function. +func Convert_ignite_KernelSpec_To_v1alpha4_KernelSpec(in *ignite.KernelSpec, out *KernelSpec, s conversion.Scope) error { + return autoConvert_ignite_KernelSpec_To_v1alpha4_KernelSpec(in, out, s) +} + +func autoConvert_v1alpha4_KernelStatus_To_ignite_KernelStatus(in *KernelStatus, out *ignite.KernelStatus, s conversion.Scope) error { + out.Version = in.Version + if err := Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_KernelStatus_To_ignite_KernelStatus is an autogenerated conversion function. +func Convert_v1alpha4_KernelStatus_To_ignite_KernelStatus(in *KernelStatus, out *ignite.KernelStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_KernelStatus_To_ignite_KernelStatus(in, out, s) +} + +func autoConvert_ignite_KernelStatus_To_v1alpha4_KernelStatus(in *ignite.KernelStatus, out *KernelStatus, s conversion.Scope) error { + out.Version = in.Version + if err := Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_KernelStatus_To_v1alpha4_KernelStatus is an autogenerated conversion function. +func Convert_ignite_KernelStatus_To_v1alpha4_KernelStatus(in *ignite.KernelStatus, out *KernelStatus, s conversion.Scope) error { + return autoConvert_ignite_KernelStatus_To_v1alpha4_KernelStatus(in, out, s) +} + +func autoConvert_v1alpha4_Network_To_ignite_Network(in *Network, out *ignite.Network, s conversion.Scope) error { + out.Plugin = network.PluginName(in.Plugin) + out.IPAddresses = *(*v1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) + return nil +} + +// Convert_v1alpha4_Network_To_ignite_Network is an autogenerated conversion function. +func Convert_v1alpha4_Network_To_ignite_Network(in *Network, out *ignite.Network, s conversion.Scope) error { + return autoConvert_v1alpha4_Network_To_ignite_Network(in, out, s) +} + +func autoConvert_ignite_Network_To_v1alpha4_Network(in *ignite.Network, out *Network, s conversion.Scope) error { + out.Plugin = network.PluginName(in.Plugin) + out.IPAddresses = *(*v1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) + return nil +} + +// Convert_ignite_Network_To_v1alpha4_Network is an autogenerated conversion function. +func Convert_ignite_Network_To_v1alpha4_Network(in *ignite.Network, out *Network, s conversion.Scope) error { + return autoConvert_ignite_Network_To_v1alpha4_Network(in, out, s) +} + +func autoConvert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource, out *ignite.OCIImageSource, s conversion.Scope) error { + out.ID = (*v1alpha1.OCIContentID)(unsafe.Pointer(in.ID)) + out.Size = in.Size + return nil +} + +// Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource is an autogenerated conversion function. +func Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource, out *ignite.OCIImageSource, s conversion.Scope) error { + return autoConvert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(in, out, s) +} + +func autoConvert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(in *ignite.OCIImageSource, out *OCIImageSource, s conversion.Scope) error { + out.ID = (*v1alpha1.OCIContentID)(unsafe.Pointer(in.ID)) + out.Size = in.Size + return nil +} + +// Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource is an autogenerated conversion function. +func Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(in *ignite.OCIImageSource, out *OCIImageSource, s conversion.Scope) error { + return autoConvert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(in, out, s) +} + +func autoConvert_v1alpha4_Pool_To_ignite_Pool(in *Pool, out *ignite.Pool, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + if err := Convert_v1alpha4_PoolSpec_To_ignite_PoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_PoolStatus_To_ignite_PoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Pool_To_ignite_Pool is an autogenerated conversion function. +func Convert_v1alpha4_Pool_To_ignite_Pool(in *Pool, out *ignite.Pool, s conversion.Scope) error { + return autoConvert_v1alpha4_Pool_To_ignite_Pool(in, out, s) +} + +func autoConvert_ignite_Pool_To_v1alpha4_Pool(in *ignite.Pool, out *Pool, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + if err := Convert_ignite_PoolSpec_To_v1alpha4_PoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_ignite_PoolStatus_To_v1alpha4_PoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_Pool_To_v1alpha4_Pool is an autogenerated conversion function. +func Convert_ignite_Pool_To_v1alpha4_Pool(in *ignite.Pool, out *Pool, s conversion.Scope) error { + return autoConvert_ignite_Pool_To_v1alpha4_Pool(in, out, s) +} + +func autoConvert_v1alpha4_PoolDevice_To_ignite_PoolDevice(in *PoolDevice, out *ignite.PoolDevice, s conversion.Scope) error { + out.Size = in.Size + out.Parent = in.Parent + out.Type = ignite.PoolDeviceType(in.Type) + out.MetadataPath = in.MetadataPath + return nil +} + +// Convert_v1alpha4_PoolDevice_To_ignite_PoolDevice is an autogenerated conversion function. +func Convert_v1alpha4_PoolDevice_To_ignite_PoolDevice(in *PoolDevice, out *ignite.PoolDevice, s conversion.Scope) error { + return autoConvert_v1alpha4_PoolDevice_To_ignite_PoolDevice(in, out, s) +} + +func autoConvert_ignite_PoolDevice_To_v1alpha4_PoolDevice(in *ignite.PoolDevice, out *PoolDevice, s conversion.Scope) error { + out.Size = in.Size + out.Parent = in.Parent + out.Type = PoolDeviceType(in.Type) + out.MetadataPath = in.MetadataPath + return nil +} + +// Convert_ignite_PoolDevice_To_v1alpha4_PoolDevice is an autogenerated conversion function. +func Convert_ignite_PoolDevice_To_v1alpha4_PoolDevice(in *ignite.PoolDevice, out *PoolDevice, s conversion.Scope) error { + return autoConvert_ignite_PoolDevice_To_v1alpha4_PoolDevice(in, out, s) +} + +func autoConvert_v1alpha4_PoolSpec_To_ignite_PoolSpec(in *PoolSpec, out *ignite.PoolSpec, s conversion.Scope) error { + out.MetadataSize = in.MetadataSize + out.DataSize = in.DataSize + out.AllocationSize = in.AllocationSize + out.MetadataPath = in.MetadataPath + out.DataPath = in.DataPath + return nil +} + +// Convert_v1alpha4_PoolSpec_To_ignite_PoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_PoolSpec_To_ignite_PoolSpec(in *PoolSpec, out *ignite.PoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_PoolSpec_To_ignite_PoolSpec(in, out, s) +} + +func autoConvert_ignite_PoolSpec_To_v1alpha4_PoolSpec(in *ignite.PoolSpec, out *PoolSpec, s conversion.Scope) error { + out.MetadataSize = in.MetadataSize + out.DataSize = in.DataSize + out.AllocationSize = in.AllocationSize + out.MetadataPath = in.MetadataPath + out.DataPath = in.DataPath + return nil +} + +// Convert_ignite_PoolSpec_To_v1alpha4_PoolSpec is an autogenerated conversion function. +func Convert_ignite_PoolSpec_To_v1alpha4_PoolSpec(in *ignite.PoolSpec, out *PoolSpec, s conversion.Scope) error { + return autoConvert_ignite_PoolSpec_To_v1alpha4_PoolSpec(in, out, s) +} + +func autoConvert_v1alpha4_PoolStatus_To_ignite_PoolStatus(in *PoolStatus, out *ignite.PoolStatus, s conversion.Scope) error { + out.Devices = *(*[]*ignite.PoolDevice)(unsafe.Pointer(&in.Devices)) + return nil +} + +// Convert_v1alpha4_PoolStatus_To_ignite_PoolStatus is an autogenerated conversion function. +func Convert_v1alpha4_PoolStatus_To_ignite_PoolStatus(in *PoolStatus, out *ignite.PoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_PoolStatus_To_ignite_PoolStatus(in, out, s) +} + +func autoConvert_ignite_PoolStatus_To_v1alpha4_PoolStatus(in *ignite.PoolStatus, out *PoolStatus, s conversion.Scope) error { + out.Devices = *(*[]*PoolDevice)(unsafe.Pointer(&in.Devices)) + return nil +} + +// Convert_ignite_PoolStatus_To_v1alpha4_PoolStatus is an autogenerated conversion function. +func Convert_ignite_PoolStatus_To_v1alpha4_PoolStatus(in *ignite.PoolStatus, out *PoolStatus, s conversion.Scope) error { + return autoConvert_ignite_PoolStatus_To_v1alpha4_PoolStatus(in, out, s) +} + +func autoConvert_v1alpha4_Runtime_To_ignite_Runtime(in *Runtime, out *ignite.Runtime, s conversion.Scope) error { + out.ID = in.ID + out.Name = pkgruntime.Name(in.Name) + return nil +} + +// Convert_v1alpha4_Runtime_To_ignite_Runtime is an autogenerated conversion function. +func Convert_v1alpha4_Runtime_To_ignite_Runtime(in *Runtime, out *ignite.Runtime, s conversion.Scope) error { + return autoConvert_v1alpha4_Runtime_To_ignite_Runtime(in, out, s) +} + +func autoConvert_ignite_Runtime_To_v1alpha4_Runtime(in *ignite.Runtime, out *Runtime, s conversion.Scope) error { + out.ID = in.ID + out.Name = pkgruntime.Name(in.Name) + return nil +} + +// Convert_ignite_Runtime_To_v1alpha4_Runtime is an autogenerated conversion function. +func Convert_ignite_Runtime_To_v1alpha4_Runtime(in *ignite.Runtime, out *Runtime, s conversion.Scope) error { + return autoConvert_ignite_Runtime_To_v1alpha4_Runtime(in, out, s) +} + +func autoConvert_v1alpha4_SSH_To_ignite_SSH(in *SSH, out *ignite.SSH, s conversion.Scope) error { + out.Generate = in.Generate + out.PublicKey = in.PublicKey + return nil +} + +// Convert_v1alpha4_SSH_To_ignite_SSH is an autogenerated conversion function. +func Convert_v1alpha4_SSH_To_ignite_SSH(in *SSH, out *ignite.SSH, s conversion.Scope) error { + return autoConvert_v1alpha4_SSH_To_ignite_SSH(in, out, s) +} + +func autoConvert_ignite_SSH_To_v1alpha4_SSH(in *ignite.SSH, out *SSH, s conversion.Scope) error { + out.Generate = in.Generate + out.PublicKey = in.PublicKey + return nil +} + +// Convert_ignite_SSH_To_v1alpha4_SSH is an autogenerated conversion function. +func Convert_ignite_SSH_To_v1alpha4_SSH(in *ignite.SSH, out *SSH, s conversion.Scope) error { + return autoConvert_ignite_SSH_To_v1alpha4_SSH(in, out, s) +} + +func autoConvert_v1alpha4_VM_To_ignite_VM(in *VM, out *ignite.VM, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_VMSpec_To_ignite_VMSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_VMStatus_To_ignite_VMStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_VM_To_ignite_VM is an autogenerated conversion function. +func Convert_v1alpha4_VM_To_ignite_VM(in *VM, out *ignite.VM, s conversion.Scope) error { + return autoConvert_v1alpha4_VM_To_ignite_VM(in, out, s) +} + +func autoConvert_ignite_VM_To_v1alpha4_VM(in *ignite.VM, out *VM, s conversion.Scope) error { + out.TypeMeta = in.TypeMeta + out.ObjectMeta = in.ObjectMeta + if err := Convert_ignite_VMSpec_To_v1alpha4_VMSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_ignite_VMStatus_To_v1alpha4_VMStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_ignite_VM_To_v1alpha4_VM is an autogenerated conversion function. +func Convert_ignite_VM_To_v1alpha4_VM(in *ignite.VM, out *VM, s conversion.Scope) error { + return autoConvert_ignite_VM_To_v1alpha4_VM(in, out, s) +} + +func autoConvert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(in *VMImageSpec, out *ignite.VMImageSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(in *VMImageSpec, out *ignite.VMImageSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(in, out, s) +} + +func autoConvert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(in *ignite.VMImageSpec, out *VMImageSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec is an autogenerated conversion function. +func Convert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(in *ignite.VMImageSpec, out *VMImageSpec, s conversion.Scope) error { + return autoConvert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(in, out, s) +} + +func autoConvert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(in *VMKernelSpec, out *ignite.VMKernelSpec, s conversion.Scope) error { + out.OCI = in.OCI + out.CmdLine = in.CmdLine + return nil +} + +// Convert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(in *VMKernelSpec, out *ignite.VMKernelSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(in, out, s) +} + +func autoConvert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(in *ignite.VMKernelSpec, out *VMKernelSpec, s conversion.Scope) error { + out.OCI = in.OCI + out.CmdLine = in.CmdLine + return nil +} + +// Convert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec is an autogenerated conversion function. +func Convert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(in *ignite.VMKernelSpec, out *VMKernelSpec, s conversion.Scope) error { + return autoConvert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(in, out, s) +} + +func autoConvert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(in *VMNetworkSpec, out *ignite.VMNetworkSpec, s conversion.Scope) error { + out.Ports = *(*v1alpha1.PortMappings)(unsafe.Pointer(&in.Ports)) + return nil +} + +// Convert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(in *VMNetworkSpec, out *ignite.VMNetworkSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(in, out, s) +} + +func autoConvert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(in *ignite.VMNetworkSpec, out *VMNetworkSpec, s conversion.Scope) error { + out.Ports = *(*v1alpha1.PortMappings)(unsafe.Pointer(&in.Ports)) + return nil +} + +// Convert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec is an autogenerated conversion function. +func Convert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(in *ignite.VMNetworkSpec, out *VMNetworkSpec, s conversion.Scope) error { + return autoConvert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(in, out, s) +} + +func autoConvert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(in *VMSandboxSpec, out *ignite.VMSandboxSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(in *VMSandboxSpec, out *ignite.VMSandboxSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(in, out, s) +} + +func autoConvert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(in *ignite.VMSandboxSpec, out *VMSandboxSpec, s conversion.Scope) error { + out.OCI = in.OCI + return nil +} + +// Convert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec is an autogenerated conversion function. +func Convert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(in *ignite.VMSandboxSpec, out *VMSandboxSpec, s conversion.Scope) error { + return autoConvert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(in, out, s) +} + +func autoConvert_v1alpha4_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(&in.Image, &out.Image, s); err != nil { + return err + } + if err := Convert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(&in.Sandbox, &out.Sandbox, s); err != nil { + return err + } + if err := Convert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(&in.Kernel, &out.Kernel, s); err != nil { + return err + } + out.CPUs = in.CPUs + out.Memory = in.Memory + out.DiskSize = in.DiskSize + if err := Convert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(&in.Network, &out.Network, s); err != nil { + return err + } + if err := Convert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(&in.Storage, &out.Storage, s); err != nil { + return err + } + out.CopyFiles = *(*[]ignite.FileMapping)(unsafe.Pointer(&in.CopyFiles)) + out.SSH = (*ignite.SSH)(unsafe.Pointer(in.SSH)) + return nil +} + +// Convert_v1alpha4_VMSpec_To_ignite_VMSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMSpec_To_ignite_VMSpec(in, out, s) +} + +func autoConvert_ignite_VMSpec_To_v1alpha4_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error { + if err := Convert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(&in.Image, &out.Image, s); err != nil { + return err + } + if err := Convert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(&in.Sandbox, &out.Sandbox, s); err != nil { + return err + } + if err := Convert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(&in.Kernel, &out.Kernel, s); err != nil { + return err + } + out.CPUs = in.CPUs + out.Memory = in.Memory + out.DiskSize = in.DiskSize + if err := Convert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(&in.Network, &out.Network, s); err != nil { + return err + } + if err := Convert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(&in.Storage, &out.Storage, s); err != nil { + return err + } + out.CopyFiles = *(*[]FileMapping)(unsafe.Pointer(&in.CopyFiles)) + out.SSH = (*SSH)(unsafe.Pointer(in.SSH)) + return nil +} + +// Convert_ignite_VMSpec_To_v1alpha4_VMSpec is an autogenerated conversion function. +func Convert_ignite_VMSpec_To_v1alpha4_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error { + return autoConvert_ignite_VMSpec_To_v1alpha4_VMSpec(in, out, s) +} + +func autoConvert_v1alpha4_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { + out.Running = in.Running + out.Runtime = (*ignite.Runtime)(unsafe.Pointer(in.Runtime)) + out.StartTime = (*libgitopspkgruntime.Time)(unsafe.Pointer(in.StartTime)) + out.Network = (*ignite.Network)(unsafe.Pointer(in.Network)) + if err := Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(&in.Image, &out.Image, s); err != nil { + return err + } + if err := Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(&in.Kernel, &out.Kernel, s); err != nil { + return err + } + out.IDPrefix = in.IDPrefix + return nil +} + +// Convert_v1alpha4_VMStatus_To_ignite_VMStatus is an autogenerated conversion function. +func Convert_v1alpha4_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_VMStatus_To_ignite_VMStatus(in, out, s) +} + +func autoConvert_ignite_VMStatus_To_v1alpha4_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { + out.Running = in.Running + out.Runtime = (*Runtime)(unsafe.Pointer(in.Runtime)) + out.StartTime = (*libgitopspkgruntime.Time)(unsafe.Pointer(in.StartTime)) + out.Network = (*Network)(unsafe.Pointer(in.Network)) + if err := Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(&in.Image, &out.Image, s); err != nil { + return err + } + if err := Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(&in.Kernel, &out.Kernel, s); err != nil { + return err + } + out.IDPrefix = in.IDPrefix + return nil +} + +// Convert_ignite_VMStatus_To_v1alpha4_VMStatus is an autogenerated conversion function. +func Convert_ignite_VMStatus_To_v1alpha4_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { + return autoConvert_ignite_VMStatus_To_v1alpha4_VMStatus(in, out, s) +} + +func autoConvert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(in *VMStorageSpec, out *ignite.VMStorageSpec, s conversion.Scope) error { + out.Volumes = *(*[]ignite.Volume)(unsafe.Pointer(&in.Volumes)) + out.VolumeMounts = *(*[]ignite.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) + return nil +} + +// Convert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec is an autogenerated conversion function. +func Convert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(in *VMStorageSpec, out *ignite.VMStorageSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(in, out, s) +} + +func autoConvert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(in *ignite.VMStorageSpec, out *VMStorageSpec, s conversion.Scope) error { + out.Volumes = *(*[]Volume)(unsafe.Pointer(&in.Volumes)) + out.VolumeMounts = *(*[]VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) + return nil +} + +// Convert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec is an autogenerated conversion function. +func Convert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(in *ignite.VMStorageSpec, out *VMStorageSpec, s conversion.Scope) error { + return autoConvert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(in, out, s) +} + +func autoConvert_v1alpha4_Volume_To_ignite_Volume(in *Volume, out *ignite.Volume, s conversion.Scope) error { + out.Name = in.Name + out.BlockDevice = (*ignite.BlockDeviceVolume)(unsafe.Pointer(in.BlockDevice)) + return nil +} + +// Convert_v1alpha4_Volume_To_ignite_Volume is an autogenerated conversion function. +func Convert_v1alpha4_Volume_To_ignite_Volume(in *Volume, out *ignite.Volume, s conversion.Scope) error { + return autoConvert_v1alpha4_Volume_To_ignite_Volume(in, out, s) +} + +func autoConvert_ignite_Volume_To_v1alpha4_Volume(in *ignite.Volume, out *Volume, s conversion.Scope) error { + out.Name = in.Name + out.BlockDevice = (*BlockDeviceVolume)(unsafe.Pointer(in.BlockDevice)) + return nil +} + +// Convert_ignite_Volume_To_v1alpha4_Volume is an autogenerated conversion function. +func Convert_ignite_Volume_To_v1alpha4_Volume(in *ignite.Volume, out *Volume, s conversion.Scope) error { + return autoConvert_ignite_Volume_To_v1alpha4_Volume(in, out, s) +} + +func autoConvert_v1alpha4_VolumeMount_To_ignite_VolumeMount(in *VolumeMount, out *ignite.VolumeMount, s conversion.Scope) error { + out.Name = in.Name + out.MountPath = in.MountPath + return nil +} + +// Convert_v1alpha4_VolumeMount_To_ignite_VolumeMount is an autogenerated conversion function. +func Convert_v1alpha4_VolumeMount_To_ignite_VolumeMount(in *VolumeMount, out *ignite.VolumeMount, s conversion.Scope) error { + return autoConvert_v1alpha4_VolumeMount_To_ignite_VolumeMount(in, out, s) +} + +func autoConvert_ignite_VolumeMount_To_v1alpha4_VolumeMount(in *ignite.VolumeMount, out *VolumeMount, s conversion.Scope) error { + out.Name = in.Name + out.MountPath = in.MountPath + return nil +} + +// Convert_ignite_VolumeMount_To_v1alpha4_VolumeMount is an autogenerated conversion function. +func Convert_ignite_VolumeMount_To_v1alpha4_VolumeMount(in *ignite.VolumeMount, out *VolumeMount, s conversion.Scope) error { + return autoConvert_ignite_VolumeMount_To_v1alpha4_VolumeMount(in, out, s) +} diff --git a/pkg/apis/ignite/v1alpha4/zz_generated.deepcopy.go b/pkg/apis/ignite/v1alpha4/zz_generated.deepcopy.go new file mode 100644 index 000000000..9e2926074 --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/zz_generated.deepcopy.go @@ -0,0 +1,618 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + net "net" + + v1alpha1 "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + pkgruntime "github.com/weaveworks/libgitops/pkg/runtime" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceVolume) DeepCopyInto(out *BlockDeviceVolume) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceVolume. +func (in *BlockDeviceVolume) DeepCopy() *BlockDeviceVolume { + if in == nil { + return nil + } + out := new(BlockDeviceVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Configuration) DeepCopyInto(out *Configuration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration. +func (in *Configuration) DeepCopy() *Configuration { + if in == nil { + return nil + } + out := new(Configuration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Configuration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { + *out = *in + in.VMDefaults.DeepCopyInto(&out.VMDefaults) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec. +func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec { + if in == nil { + return nil + } + out := new(ConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FileMapping) DeepCopyInto(out *FileMapping) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileMapping. +func (in *FileMapping) DeepCopy() *FileMapping { + if in == nil { + return nil + } + out := new(FileMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Image) DeepCopyInto(out *Image) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image. +func (in *Image) DeepCopy() *Image { + if in == nil { + return nil + } + out := new(Image) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Image) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageSpec) DeepCopyInto(out *ImageSpec) { + *out = *in + out.OCI = in.OCI + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec. +func (in *ImageSpec) DeepCopy() *ImageSpec { + if in == nil { + return nil + } + out := new(ImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageStatus) DeepCopyInto(out *ImageStatus) { + *out = *in + in.OCISource.DeepCopyInto(&out.OCISource) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageStatus. +func (in *ImageStatus) DeepCopy() *ImageStatus { + if in == nil { + return nil + } + out := new(ImageStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Kernel) DeepCopyInto(out *Kernel) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kernel. +func (in *Kernel) DeepCopy() *Kernel { + if in == nil { + return nil + } + out := new(Kernel) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Kernel) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KernelSpec) DeepCopyInto(out *KernelSpec) { + *out = *in + out.OCI = in.OCI + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelSpec. +func (in *KernelSpec) DeepCopy() *KernelSpec { + if in == nil { + return nil + } + out := new(KernelSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KernelStatus) DeepCopyInto(out *KernelStatus) { + *out = *in + in.OCISource.DeepCopyInto(&out.OCISource) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelStatus. +func (in *KernelStatus) DeepCopy() *KernelStatus { + if in == nil { + return nil + } + out := new(KernelStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Network) DeepCopyInto(out *Network) { + *out = *in + if in.IPAddresses != nil { + in, out := &in.IPAddresses, &out.IPAddresses + *out = make(v1alpha1.IPAddresses, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(net.IP, len(*in)) + copy(*out, *in) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. +func (in *Network) DeepCopy() *Network { + if in == nil { + return nil + } + out := new(Network) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OCIImageSource) DeepCopyInto(out *OCIImageSource) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(v1alpha1.OCIContentID) + **out = **in + } + out.Size = in.Size + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCIImageSource. +func (in *OCIImageSource) DeepCopy() *OCIImageSource { + if in == nil { + return nil + } + out := new(OCIImageSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Pool) DeepCopyInto(out *Pool) { + *out = *in + out.TypeMeta = in.TypeMeta + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool. +func (in *Pool) DeepCopy() *Pool { + if in == nil { + return nil + } + out := new(Pool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Pool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolDevice) DeepCopyInto(out *PoolDevice) { + *out = *in + out.Size = in.Size + out.Parent = in.Parent + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolDevice. +func (in *PoolDevice) DeepCopy() *PoolDevice { + if in == nil { + return nil + } + out := new(PoolDevice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolSpec) DeepCopyInto(out *PoolSpec) { + *out = *in + out.MetadataSize = in.MetadataSize + out.DataSize = in.DataSize + out.AllocationSize = in.AllocationSize + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolSpec. +func (in *PoolSpec) DeepCopy() *PoolSpec { + if in == nil { + return nil + } + out := new(PoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolStatus) DeepCopyInto(out *PoolStatus) { + *out = *in + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]*PoolDevice, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(PoolDevice) + **out = **in + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolStatus. +func (in *PoolStatus) DeepCopy() *PoolStatus { + if in == nil { + return nil + } + out := new(PoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Runtime) DeepCopyInto(out *Runtime) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Runtime. +func (in *Runtime) DeepCopy() *Runtime { + if in == nil { + return nil + } + out := new(Runtime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSH) DeepCopyInto(out *SSH) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSH. +func (in *SSH) DeepCopy() *SSH { + if in == nil { + return nil + } + out := new(SSH) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VM) DeepCopyInto(out *VM) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VM. +func (in *VM) DeepCopy() *VM { + if in == nil { + return nil + } + out := new(VM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VM) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMImageSpec) DeepCopyInto(out *VMImageSpec) { + *out = *in + out.OCI = in.OCI + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMImageSpec. +func (in *VMImageSpec) DeepCopy() *VMImageSpec { + if in == nil { + return nil + } + out := new(VMImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMKernelSpec) DeepCopyInto(out *VMKernelSpec) { + *out = *in + out.OCI = in.OCI + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMKernelSpec. +func (in *VMKernelSpec) DeepCopy() *VMKernelSpec { + if in == nil { + return nil + } + out := new(VMKernelSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMNetworkSpec) DeepCopyInto(out *VMNetworkSpec) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make(v1alpha1.PortMappings, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMNetworkSpec. +func (in *VMNetworkSpec) DeepCopy() *VMNetworkSpec { + if in == nil { + return nil + } + out := new(VMNetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMSandboxSpec) DeepCopyInto(out *VMSandboxSpec) { + *out = *in + out.OCI = in.OCI + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMSandboxSpec. +func (in *VMSandboxSpec) DeepCopy() *VMSandboxSpec { + if in == nil { + return nil + } + out := new(VMSandboxSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMSpec) DeepCopyInto(out *VMSpec) { + *out = *in + out.Image = in.Image + out.Sandbox = in.Sandbox + out.Kernel = in.Kernel + out.Memory = in.Memory + out.DiskSize = in.DiskSize + in.Network.DeepCopyInto(&out.Network) + in.Storage.DeepCopyInto(&out.Storage) + if in.CopyFiles != nil { + in, out := &in.CopyFiles, &out.CopyFiles + *out = make([]FileMapping, len(*in)) + copy(*out, *in) + } + if in.SSH != nil { + in, out := &in.SSH, &out.SSH + *out = new(SSH) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMSpec. +func (in *VMSpec) DeepCopy() *VMSpec { + if in == nil { + return nil + } + out := new(VMSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMStatus) DeepCopyInto(out *VMStatus) { + *out = *in + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(Runtime) + **out = **in + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = new(pkgruntime.Time) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(Network) + (*in).DeepCopyInto(*out) + } + in.Image.DeepCopyInto(&out.Image) + in.Kernel.DeepCopyInto(&out.Kernel) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMStatus. +func (in *VMStatus) DeepCopy() *VMStatus { + if in == nil { + return nil + } + out := new(VMStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMStorageSpec) DeepCopyInto(out *VMStorageSpec) { + *out = *in + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]VolumeMount, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMStorageSpec. +func (in *VMStorageSpec) DeepCopy() *VMStorageSpec { + if in == nil { + return nil + } + out := new(VMStorageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Volume) DeepCopyInto(out *Volume) { + *out = *in + if in.BlockDevice != nil { + in, out := &in.BlockDevice, &out.BlockDevice + *out = new(BlockDeviceVolume) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume. +func (in *Volume) DeepCopy() *Volume { + if in == nil { + return nil + } + out := new(Volume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeMount) DeepCopyInto(out *VolumeMount) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeMount. +func (in *VolumeMount) DeepCopy() *VolumeMount { + if in == nil { + return nil + } + out := new(VolumeMount) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/ignite/v1alpha4/zz_generated.defaults.go b/pkg/apis/ignite/v1alpha4/zz_generated.defaults.go new file mode 100644 index 000000000..942e3a4e7 --- /dev/null +++ b/pkg/apis/ignite/v1alpha4/zz_generated.defaults.go @@ -0,0 +1,37 @@ +// +build !ignore_autogenerated + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// 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 RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&Configuration{}, func(obj interface{}) { SetObjectDefaults_Configuration(obj.(*Configuration)) }) + scheme.AddTypeDefaultingFunc(&Pool{}, func(obj interface{}) { SetObjectDefaults_Pool(obj.(*Pool)) }) + scheme.AddTypeDefaultingFunc(&VM{}, func(obj interface{}) { SetObjectDefaults_VM(obj.(*VM)) }) + return nil +} + +func SetObjectDefaults_Configuration(in *Configuration) { + SetDefaults_ConfigurationSpec(&in.Spec) + SetDefaults_VMSpec(&in.Spec.VMDefaults) + SetDefaults_VMSandboxSpec(&in.Spec.VMDefaults.Sandbox) + SetDefaults_VMKernelSpec(&in.Spec.VMDefaults.Kernel) +} + +func SetObjectDefaults_Pool(in *Pool) { + SetDefaults_PoolSpec(&in.Spec) +} + +func SetObjectDefaults_VM(in *VM) { + SetDefaults_VMSpec(&in.Spec) + SetDefaults_VMSandboxSpec(&in.Spec.Sandbox) + SetDefaults_VMKernelSpec(&in.Spec.Kernel) + SetDefaults_VMStatus(&in.Status) +} diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index 05e3a4886..8a376bbb5 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -66,6 +66,34 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3.VMStorageSpec": schema_pkg_apis_ignite_v1alpha3_VMStorageSpec(ref), "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3.Volume": schema_pkg_apis_ignite_v1alpha3_Volume(ref), "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3.VolumeMount": schema_pkg_apis_ignite_v1alpha3_VolumeMount(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.BlockDeviceVolume": schema_pkg_apis_ignite_v1alpha4_BlockDeviceVolume(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Configuration": schema_pkg_apis_ignite_v1alpha4_Configuration(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ConfigurationSpec": schema_pkg_apis_ignite_v1alpha4_ConfigurationSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.FileMapping": schema_pkg_apis_ignite_v1alpha4_FileMapping(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Image": schema_pkg_apis_ignite_v1alpha4_Image(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageSpec": schema_pkg_apis_ignite_v1alpha4_ImageSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageStatus": schema_pkg_apis_ignite_v1alpha4_ImageStatus(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Kernel": schema_pkg_apis_ignite_v1alpha4_Kernel(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelSpec": schema_pkg_apis_ignite_v1alpha4_KernelSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelStatus": schema_pkg_apis_ignite_v1alpha4_KernelStatus(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Network": schema_pkg_apis_ignite_v1alpha4_Network(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource": schema_pkg_apis_ignite_v1alpha4_OCIImageSource(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Pool": schema_pkg_apis_ignite_v1alpha4_Pool(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolDevice": schema_pkg_apis_ignite_v1alpha4_PoolDevice(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolSpec": schema_pkg_apis_ignite_v1alpha4_PoolSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolStatus": schema_pkg_apis_ignite_v1alpha4_PoolStatus(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Runtime": schema_pkg_apis_ignite_v1alpha4_Runtime(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.SSH": schema_pkg_apis_ignite_v1alpha4_SSH(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VM": schema_pkg_apis_ignite_v1alpha4_VM(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMImageSpec": schema_pkg_apis_ignite_v1alpha4_VMImageSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMKernelSpec": schema_pkg_apis_ignite_v1alpha4_VMKernelSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMNetworkSpec": schema_pkg_apis_ignite_v1alpha4_VMNetworkSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSandboxSpec": schema_pkg_apis_ignite_v1alpha4_VMSandboxSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSpec": schema_pkg_apis_ignite_v1alpha4_VMSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStatus": schema_pkg_apis_ignite_v1alpha4_VMStatus(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStorageSpec": schema_pkg_apis_ignite_v1alpha4_VMStorageSpec(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Volume": schema_pkg_apis_ignite_v1alpha4_Volume(ref), + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VolumeMount": schema_pkg_apis_ignite_v1alpha4_VolumeMount(ref), "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.DMID": schema_pkg_apis_meta_v1alpha1_DMID(ref), "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIContentID": schema_pkg_apis_meta_v1alpha1_OCIContentID(ref), "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef": schema_pkg_apis_meta_v1alpha1_OCIImageRef(ref), @@ -1841,6 +1869,946 @@ func schema_pkg_apis_ignite_v1alpha3_VolumeMount(ref common.ReferenceCallback) c } } +func schema_pkg_apis_ignite_v1alpha4_BlockDeviceVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BlockDeviceVolume defines a block device on the host", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path"}, + }, + }, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Configuration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Configuration represents the ignite runtime configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ConfigurationSpec"), + }, + }, + }, + Required: []string{"TypeMeta", "metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ConfigurationSpec", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_ConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConfigurationSpec defines the ignite configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "runtime": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "networkPlugin": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "vmDefaults": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSpec"), + }, + }, + "idPrefix": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSpec"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_FileMapping(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileMapping defines mappings between files on the host and VM", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostPath": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "vmPath": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"hostPath", "vmPath"}, + }, + }, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Image(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Image represents a cached OCI image ready to be used with Ignite", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "runtime.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)", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageStatus"), + }, + }, + }, + Required: []string{"TypeMeta", "metadata", "spec", "status"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.ImageStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_ImageSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ImageSpec declares what the image contains", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "oci": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), + }, + }, + }, + Required: []string{"oci"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_ImageStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ImageStatus defines the status of the image", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "ociSource": { + SchemaProps: spec.SchemaProps{ + Description: "OCISource contains the information about how this OCI image was imported", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"), + }, + }, + }, + Required: []string{"ociSource"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Kernel(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "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", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "runtime.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)", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelStatus"), + }, + }, + }, + Required: []string{"TypeMeta", "metadata", "spec", "status"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.KernelStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_KernelSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KernelSpec describes the properties of a kernel", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "oci": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), + }, + }, + }, + Required: []string{"oci"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_KernelStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KernelStatus describes the status of a kernel", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "ociSource": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"), + }, + }, + }, + Required: []string{"version", "ociSource"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Network(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Network specifies the VM's network information.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "plugin": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "ipAddresses": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "byte", + }, + }, + }, + }, + }, + }, + Required: []string{"plugin", "ipAddresses"}, + }, + }, + } +} + +func schema_pkg_apis_ignite_v1alpha4_OCIImageSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "OCIImageSource specifies how the OCI image was imported. It is the status variant of OCIImageClaim", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Description: "ID defines the source's content ID (e.g. the canonical OCI path or Docker image ID)", + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIContentID"), + }, + }, + "size": { + SchemaProps: spec.SchemaProps{ + Description: "Size defines the size of the source in bytes", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + }, + Required: []string{"id", "size"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIContentID", "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Pool(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "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", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolStatus"), + }, + }, + }, + Required: []string{"TypeMeta", "spec", "status"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_PoolDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PoolDevice defines one device in the pool", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "size": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "parent": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.DMID"), + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type specifies the type of the contents of the device", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadataPath": { + SchemaProps: spec.SchemaProps{ + Description: "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", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"size", "parent", "type", "metadataPath"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.DMID", "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_PoolSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PoolSpec defines the Pool's specification", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadataSize": { + SchemaProps: spec.SchemaProps{ + Description: "MetadataSize specifies the size of the pool's metadata", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "dataSize": { + SchemaProps: spec.SchemaProps{ + Description: "DataSize specifies the size of the pool's data", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "allocationSize": { + SchemaProps: spec.SchemaProps{ + Description: "AllocationSize specifies the smallest size that can be allocated at a time", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "metadataPath": { + SchemaProps: spec.SchemaProps{ + Description: "MetadataPath points to the file where device mapper stores all metadata information Defaults to constants.SNAPSHOTTER_METADATA_PATH", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "dataPath": { + SchemaProps: spec.SchemaProps{ + Description: "DataPath points to the backing physical device or sparse file (to be loop mounted) for the pool Defaults to constants.SNAPSHOTTER_DATA_PATH", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"metadataSize", "dataSize", "allocationSize", "metadataPath", "dataPath"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_PoolStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PoolStatus defines the Pool's current status", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "devices": { + SchemaProps: spec.SchemaProps{ + Description: "The Devices array needs to contain pointers to accommodate \"holes\" in the mapping Where devices have been deleted, the pointer is nil", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolDevice"), + }, + }, + }, + }, + }, + }, + Required: []string{"devices"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.PoolDevice"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Runtime(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Runtime specifies the VM's runtime information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"id", "name"}, + }, + }, + } +} + +func schema_pkg_apis_ignite_v1alpha4_SSH(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "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.", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VM(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VM represents a virtual machine run by Firecracker These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "runtime.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)", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStatus"), + }, + }, + }, + Required: []string{"TypeMeta", "metadata", "spec", "status"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMImageSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "oci": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), + }, + }, + }, + Required: []string{"oci"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMKernelSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "oci": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), + }, + }, + "cmdLine": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"oci"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMNetworkSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "ports": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.PortMapping"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.PortMapping"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMSandboxSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VMSandboxSpec is the spec of the sandbox used for the VM.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "oci": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), + }, + }, + }, + Required: []string{"oci"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VMSpec describes the configuration of a VM", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "image": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMImageSpec"), + }, + }, + "sandbox": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSandboxSpec"), + }, + }, + "kernel": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMKernelSpec"), + }, + }, + "cpus": { + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "memory": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "diskSize": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), + }, + }, + "network": { + SchemaProps: spec.SchemaProps{ + Description: "Currently both will show in the JSON output as empty arrays. Making them pointers requires plenty of nil checks (as their contents are accessed directly) and is very risky for stability. APIMachinery potentially has a solution.", + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMNetworkSpec"), + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStorageSpec"), + }, + }, + "copyFiles": { + SchemaProps: spec.SchemaProps{ + Description: "This will be done at either \"ignite start\" or \"ignite create\" time", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.FileMapping"), + }, + }, + }, + }, + }, + "ssh": { + SchemaProps: spec.SchemaProps{ + Description: "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", + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.SSH"), + }, + }, + }, + Required: []string{"image", "sandbox", "kernel", "cpus", "memory", "diskSize"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.FileMapping", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.SSH", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMImageSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMKernelSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMNetworkSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMSandboxSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VMStorageSpec", "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VMStatus defines the status of a VM", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "running": { + SchemaProps: spec.SchemaProps{ + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "runtime": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Runtime"), + }, + }, + "startTime": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.Time"), + }, + }, + "network": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Network"), + }, + }, + "image": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"), + }, + }, + "kernel": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource"), + }, + }, + "idPrefix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"running", "image", "kernel", "idPrefix"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Network", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.OCIImageSource", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Runtime", "github.com/weaveworks/libgitops/pkg/runtime.Time"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VMStorageSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VMStorageSpec defines the VM's Volumes and VolumeMounts", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "volumes": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Volume"), + }, + }, + }, + }, + }, + "volumeMounts": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VolumeMount"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.Volume", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.VolumeMount"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_Volume(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Volume defines named storage volume", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "blockDevice": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.BlockDeviceVolume"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4.BlockDeviceVolume"}, + } +} + +func schema_pkg_apis_ignite_v1alpha4_VolumeMount(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeMount defines the mount point for a named volume inside a VM", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "mountPath": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "mountPath"}, + }, + }, + } +} + func schema_pkg_apis_meta_v1alpha1_DMID(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/openapi/violations.txt b/pkg/openapi/violations.txt index fa5578e6a..569b63276 100644 --- a/pkg/openapi/violations.txt +++ b/pkg/openapi/violations.txt @@ -6,8 +6,13 @@ API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/igni API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3,VMSpec,CopyFiles API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3,VMStorageSpec,VolumeMounts API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3,VMStorageSpec,Volumes +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4,PoolStatus,Devices +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4,VMSpec,CopyFiles +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4,VMStorageSpec,VolumeMounts +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4,VMStorageSpec,Volumes API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha3,VMSpec,CPUs +API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,DMID,index API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,OCIContentID,digest API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,OCIContentID,repoName