diff --git a/.circleci/config.yml b/.circleci/config.yml index b3d41704a..9909482c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,9 +39,7 @@ jobs: - restore_cache: key: bin-cache # Run autogeneration and see if there are differences - # TODO: Fix this; somehow the docs/api/ignite_v1alpha1.md ends up being malformatted in CI; it adds - # @@ in the beginning of the file for some strange reason in CI, but not locally - - run: make autogen && make tidy-in-docker && git status --short && git checkout HEAD docs/api/ignite_v1alpha1.md + - run: make autogen && make tidy-in-docker && git status --short # Save the bin/cache directory - save_cache: key: bin-cache diff --git a/Makefile b/Makefile index abb4b951b..c36e50018 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,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/v1alpha1,${APIS_DIR}/ignite/v1alpha2,${APIS_DIR}/meta/v1alpha1 +API_DIRS = ${APIS_DIR}/ignite,${APIS_DIR}/ignite/v1alpha2,${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/pkg/apis/ignite/scheme/scheme.go b/pkg/apis/ignite/scheme/scheme.go index 5dbf21b25..ef37d9065 100644 --- a/pkg/apis/ignite/scheme/scheme.go +++ b/pkg/apis/ignite/scheme/scheme.go @@ -6,7 +6,6 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "github.com/weaveworks/ignite/pkg/apis/ignite" - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1" "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2" "github.com/weaveworks/libgitops/pkg/serializer" ) @@ -30,7 +29,6 @@ func init() { // AddToScheme builds the scheme using all known versions of the api. func AddToScheme(scheme *runtime.Scheme) { utilruntime.Must(ignite.AddToScheme(Scheme)) - utilruntime.Must(v1alpha1.AddToScheme(Scheme)) utilruntime.Must(v1alpha2.AddToScheme(Scheme)) utilruntime.Must(scheme.SetVersionPriority(v1alpha2.SchemeGroupVersion)) } diff --git a/pkg/apis/ignite/v1alpha1/conversion.go b/pkg/apis/ignite/v1alpha1/conversion.go deleted file mode 100644 index 699635a95..000000000 --- a/pkg/apis/ignite/v1alpha1/conversion.go +++ /dev/null @@ -1,182 +0,0 @@ -package v1alpha1 - -import ( - "github.com/weaveworks/ignite/pkg/apis/ignite" - meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" - "k8s.io/apimachinery/pkg/conversion" -) - -// Convert_ignite_VMSpec_To_v1alpha1_VMSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_VMSpec_To_v1alpha1_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error { - // VMSpecStorage are not supported by v1alpha1, so just ignore the warning by calling this manually - return autoConvert_ignite_VMSpec_To_v1alpha1_VMSpec(in, out, s) -} - -// Convert_ignite_VMSpec_To_v1alpha1_VMSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error { - // VMSpecStorage is not supported by v1alpha1, so just ignore the warning by calling this manually - return autoConvert_v1alpha1_VMSpec_To_ignite_VMSpec(in, out, s) -} - -// Convert_ignite_VMStatus_To_v1alpha1_VMStatus calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { - if err := autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in, out, s); err != nil { - return err - } - - // Convert in.Running to out.State - if in.Running { - out.State = VMStateRunning - } else { - out.State = VMStateStopped - } - - return nil -} - -// Convert_v1alpha1_VMStatus_To_ignite_VMStatus calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { - if err := autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in, out, s); err != nil { - return err - } - - // Convert in.State to out.Running - out.Running = in.State == VMStateRunning - - return nil -} - -// Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(in *ignite.OCIImageSource, out *OCIImageSource, s conversion.Scope) error { - if err := autoConvert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(in, out, s); err != nil { - return err - } - - // If the OCI content ID is local, i.e. not available from a repository, - // populate the ID field of v1alpha1.OCIImageSource. Otherwise add the - // the repo digest of the ID as the only digest for v1alpha1. - if in.ID.Local() { - out.ID = in.ID.Digest().String() - } else { - out.RepoDigests = []string{in.ID.RepoDigest().String()} - } - - return nil -} - -// Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource, out *ignite.OCIImageSource, s conversion.Scope) (err error) { - if err = autoConvert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in, out, s); err != nil { - return err - } - - // By default parse the OCI content ID from the Docker image ID - contentRef := in.ID - if len(in.RepoDigests) > 0 { - // If the image has Repo digests, use the first one of them to parse - // the fully qualified OCI image name and digest. All of the digests - // point to the same contents, so it doesn't matter which one we use - // here. It will be translated to the right content by the runtime. - contentRef = in.RepoDigests[0] - } - - // Parse the OCI content ID based on the available reference - out.ID, err = meta.ParseOCIContentID(contentRef) - return -} - -func Convert_v1alpha1_OCIClaim_To_ignite_OCI(in *OCIImageClaim, out *meta.OCIImageRef) error { - // Convert the old OCIImageClaim format to meta.OCIImageRef - // by extracting in.Ref and ignoring in.Type - *out = in.Ref - - return nil -} - -func Convert_ignite_OCI_To_v1alpha1_OCIClaim(in *meta.OCIImageRef, out *OCIImageClaim) error { - // Convert meta.OCIImageRef to the old OCIImageClaim format, - // set out.Ref to the OCIImageRef and out.Type to the default - // ImageSourceTypeDocker - out.Ref = *in - out.Type = ImageSourceTypeDocker - - return nil -} - -// Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec(in *ignite.ImageSpec, out *ImageSpec, s conversion.Scope) error { - if err := autoConvert_ignite_ImageSpec_To_v1alpha1_ImageSpec(in, out, s); err != nil { - return err - } - - return Convert_ignite_OCI_To_v1alpha1_OCIClaim(&in.OCI, &out.OCIClaim) -} - -// Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec(in *ImageSpec, out *ignite.ImageSpec, s conversion.Scope) error { - if err := autoConvert_v1alpha1_ImageSpec_To_ignite_ImageSpec(in, out, s); err != nil { - return err - } - - return Convert_v1alpha1_OCIClaim_To_ignite_OCI(&in.OCIClaim, &out.OCI) -} - -// Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec(in *ignite.KernelSpec, out *KernelSpec, s conversion.Scope) error { - if err := autoConvert_ignite_KernelSpec_To_v1alpha1_KernelSpec(in, out, s); err != nil { - return err - } - - return Convert_ignite_OCI_To_v1alpha1_OCIClaim(&in.OCI, &out.OCIClaim) -} - -// Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec(in *KernelSpec, out *ignite.KernelSpec, s conversion.Scope) error { - if err := autoConvert_v1alpha1_KernelSpec_To_ignite_KernelSpec(in, out, s); err != nil { - return err - } - - return Convert_v1alpha1_OCIClaim_To_ignite_OCI(&in.OCIClaim, &out.OCI) -} - -// Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(in *ignite.VMImageSpec, out *VMImageSpec, s conversion.Scope) error { - if err := autoConvert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(in, out, s); err != nil { - return err - } - - return Convert_ignite_OCI_To_v1alpha1_OCIClaim(&in.OCI, &out.OCIClaim) -} - -// Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(in *VMImageSpec, out *ignite.VMImageSpec, s conversion.Scope) error { - if err := autoConvert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(in, out, s); err != nil { - return err - } - - return Convert_v1alpha1_OCIClaim_To_ignite_OCI(&in.OCIClaim, &out.OCI) -} - -// Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(in *ignite.VMKernelSpec, out *VMKernelSpec, s conversion.Scope) error { - if err := autoConvert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(in, out, s); err != nil { - return err - } - - return Convert_ignite_OCI_To_v1alpha1_OCIClaim(&in.OCI, &out.OCIClaim) -} - -// Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(in *VMKernelSpec, out *ignite.VMKernelSpec, s conversion.Scope) error { - if err := autoConvert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(in, out, s); err != nil { - return err - } - - return Convert_v1alpha1_OCIClaim_To_ignite_OCI(&in.OCIClaim, &out.OCI) -} - -// Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec calls the autogenerated conversion function along with custom conversion logic -func Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(in *VMNetworkSpec, out *ignite.VMNetworkSpec, s conversion.Scope) error { - // .Spec.Network.Mode is not tracked in v1alpha2 and newer, so there's no extra conversion logic - return autoConvert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(in, out, s) -} diff --git a/pkg/apis/ignite/v1alpha1/defaults.go b/pkg/apis/ignite/v1alpha1/defaults.go deleted file mode 100644 index 5fa68cad0..000000000 --- a/pkg/apis/ignite/v1alpha1/defaults.go +++ /dev/null @@ -1,83 +0,0 @@ -package v1alpha1 - -import ( - meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" - "github.com/weaveworks/ignite/pkg/constants" - "github.com/weaveworks/ignite/pkg/version" - "k8s.io/apimachinery/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -func SetDefaults_OCIImageClaim(obj *OCIImageClaim) { - obj.Type = ImageSourceTypeDocker -} - -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.OCIClaim.Ref.IsUnset() { - obj.OCIClaim.Ref, _ = meta.NewOCIImageRef(version.GetIgnite().KernelImage.String()) - } - - if len(obj.CmdLine) == 0 { - obj.CmdLine = constants.VM_DEFAULT_KERNEL_ARGS - } -} - -func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec) { - if len(obj.Mode) == 0 { - obj.Mode = NetworkModeDockerBridge - } -} - -func SetDefaults_VMStatus(obj *VMStatus) { - if obj.State == "" { - obj.State = VMStateCreated - } -} - -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) -} diff --git a/pkg/apis/ignite/v1alpha1/doc.go b/pkg/apis/ignite/v1alpha1/doc.go deleted file mode 100644 index 7e6bd3c3b..000000000 --- a/pkg/apis/ignite/v1alpha1/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +k8s:deepcopy-gen=package -// +k8s:defaulter-gen=TypeMeta -// +k8s:openapi-gen=true -// +k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite -package v1alpha1 diff --git a/pkg/apis/ignite/v1alpha1/json.go b/pkg/apis/ignite/v1alpha1/json.go deleted file mode 100644 index 1e7731d83..000000000 --- a/pkg/apis/ignite/v1alpha1/json.go +++ /dev/null @@ -1,50 +0,0 @@ -package v1alpha1 - -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/v1alpha1/register.go b/pkg/apis/ignite/v1alpha1/register.go deleted file mode 100644 index 9337d5231..000000000 --- a/pkg/apis/ignite/v1alpha1/register.go +++ /dev/null @@ -1,39 +0,0 @@ -package v1alpha1 - -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: "v1alpha1", -} - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &VM{}, - &Kernel{}, - &Pool{}, - &Image{}, - ) - return nil -} diff --git a/pkg/apis/ignite/v1alpha1/types.go b/pkg/apis/ignite/v1alpha1/types.go deleted file mode 100644 index b2bcc9bfd..000000000 --- a/pkg/apis/ignite/v1alpha1/types.go +++ /dev/null @@ -1,253 +0,0 @@ -package v1alpha1 - -import ( - "fmt" - - meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" - "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 { - OCIClaim OCIImageClaim `json:"ociClaim"` -} - -// ImageSourceType is an enum of different supported Image Source Types -type ImageSourceType string - -const ( - // ImageSourceTypeDocker defines that the image is imported from Docker - ImageSourceTypeDocker ImageSourceType = "Docker" -) - -// OCIImageClaim defines a claim for importing an OCI image -type OCIImageClaim struct { - // Type defines how the image should be imported - Type ImageSourceType `json:"type"` - // Ref defines the reference to use when talking to the backend. - // This is most commonly the image name, followed by a tag. - // Other supported ways are $registry/$user/$image@sha256:$digest - // This ref is also used as ObjectMeta.Name for kinds Images and Kernels - Ref meta.OCIImageRef `json:"ref"` -} - -// OCIImageSource specifies how the OCI image was imported. -// It is the status variant of OCIImageClaim -type OCIImageSource struct { - // ID defines the source's ID (e.g. the Docker image ID) - ID string `json:"id"` - // Size defines the size of the source in bytes - Size meta.Size `json:"size"` - // RepoDigests defines the image name as it was when pulled - // from a repository, and the digest of the image - // The format is $registry/$user/$image@sha256:$digest - // This field is unpopulated if the image used as the source - // has never been pushed to or pulled from a registry - RepoDigests []string `json:"repoDigests,omitempty"` -} - -// 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 { - OCIClaim OCIImageClaim `json:"ociClaim"` - // 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"` - Kernel VMKernelSpec `json:"kernel"` - CPUs uint64 `json:"cpus"` - Memory meta.Size `json:"memory"` - DiskSize meta.Size `json:"diskSize"` - Network VMNetworkSpec `json:"network"` - - // This will be done at either "ignite start" or "ignite create" time - // TODO: We might revisit this later - CopyFiles []FileMapping `json:"copyFiles,omitempty"` - // SSH specifies how the SSH setup should be done - // nil here means "don't do anything special" - // If SSH.Generate is set, Ignite will generate a new SSH key and copy it in to authorized_keys in the VM - // Specifying a path in SSH.Generate means "use this public key" - // If SSH.PublicKey is set, this struct will marshal as a string using that path - // If SSH.Generate is set, this struct will marshal as a bool => true - SSH *SSH `json:"ssh,omitempty"` -} - -type VMImageSpec struct { - OCIClaim OCIImageClaim `json:"ociClaim"` -} - -type VMKernelSpec struct { - OCIClaim OCIImageClaim `json:"ociClaim"` - CmdLine string `json:"cmdLine,omitempty"` -} - -type VMNetworkSpec struct { - Mode NetworkMode `json:"mode"` - Ports meta.PortMappings `json:"ports,omitempty"` -} - -// 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:"-"` -} - -// NetworkMode defines different states a VM can be in -type NetworkMode string - -var _ fmt.Stringer = NetworkMode("") - -func (nm NetworkMode) String() string { - return string(nm) -} - -const ( - // NetworkModeCNI specifies the network mode where CNI is used - NetworkModeCNI NetworkMode = "cni" - // NetworkModeDockerBridge specifies the default docker bridge network is used - NetworkModeDockerBridge NetworkMode = "docker-bridge" - // Whenever updating this list, also update GetNetworkModes in helpers.go -) - -// VMState defines different states a VM can be in -type VMState string - -const ( - VMStateCreated VMState = "Created" - VMStateRunning VMState = "Running" - VMStateStopped VMState = "Stopped" -) - -// VMStatus defines the status of a VM -type VMStatus struct { - State VMState `json:"state"` - IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"` - Image OCIImageSource `json:"image"` - Kernel OCIImageSource `json:"kernel"` -} diff --git a/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 74c4a1a60..000000000 --- a/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,651 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - ignite "github.com/weaveworks/ignite/pkg/apis/ignite" - metav1alpha1 "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" - 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((*FileMapping)(nil), (*ignite.FileMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_Image(a.(*ignite.Image), b.(*Image), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ImageStatus)(nil), (*ignite.ImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_Kernel(a.(*ignite.Kernel), b.(*Kernel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KernelStatus)(nil), (*ignite.KernelStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_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_v1alpha1_KernelStatus(a.(*ignite.KernelStatus), b.(*KernelStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Pool)(nil), (*ignite.Pool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_PoolStatus(a.(*ignite.PoolStatus), b.(*PoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SSH)(nil), (*ignite.SSH)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_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_v1alpha1_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_v1alpha1_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_v1alpha1_VM(a.(*ignite.VM), b.(*VM), 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_v1alpha1_VMNetworkSpec(a.(*ignite.VMNetworkSpec), b.(*VMNetworkSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.ImageSpec)(nil), (*ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec(a.(*ignite.ImageSpec), b.(*ImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.KernelSpec)(nil), (*KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec(a.(*ignite.KernelSpec), b.(*KernelSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.OCIImageSource)(nil), (*OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(a.(*ignite.OCIImageSource), b.(*OCIImageSource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.VMImageSpec)(nil), (*VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(a.(*ignite.VMImageSpec), b.(*VMImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.VMKernelSpec)(nil), (*VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(a.(*ignite.VMKernelSpec), b.(*VMKernelSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.VMSpec)(nil), (*VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_VMSpec_To_v1alpha1_VMSpec(a.(*ignite.VMSpec), b.(*VMSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ignite.VMStatus)(nil), (*VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_ignite_VMStatus_To_v1alpha1_VMStatus(a.(*ignite.VMStatus), b.(*VMStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ImageSpec)(nil), (*ignite.ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec(a.(*ImageSpec), b.(*ignite.ImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*KernelSpec)(nil), (*ignite.KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec(a.(*KernelSpec), b.(*ignite.KernelSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*OCIImageSource)(nil), (*ignite.OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(a.(*OCIImageSource), b.(*ignite.OCIImageSource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*VMImageSpec)(nil), (*ignite.VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(a.(*VMImageSpec), b.(*ignite.VMImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*VMKernelSpec)(nil), (*ignite.VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(a.(*VMKernelSpec), b.(*ignite.VMKernelSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*VMNetworkSpec)(nil), (*ignite.VMNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(a.(*VMNetworkSpec), b.(*ignite.VMNetworkSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*VMSpec)(nil), (*ignite.VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VMSpec_To_ignite_VMSpec(a.(*VMSpec), b.(*ignite.VMSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*VMStatus)(nil), (*ignite.VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VMStatus_To_ignite_VMStatus(a.(*VMStatus), b.(*ignite.VMStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_FileMapping_To_ignite_FileMapping(in *FileMapping, out *ignite.FileMapping, s conversion.Scope) error { - out.HostPath = in.HostPath - out.VMPath = in.VMPath - return nil -} - -// Convert_v1alpha1_FileMapping_To_ignite_FileMapping is an autogenerated conversion function. -func Convert_v1alpha1_FileMapping_To_ignite_FileMapping(in *FileMapping, out *ignite.FileMapping, s conversion.Scope) error { - return autoConvert_v1alpha1_FileMapping_To_ignite_FileMapping(in, out, s) -} - -func autoConvert_ignite_FileMapping_To_v1alpha1_FileMapping(in *ignite.FileMapping, out *FileMapping, s conversion.Scope) error { - out.HostPath = in.HostPath - out.VMPath = in.VMPath - return nil -} - -// Convert_ignite_FileMapping_To_v1alpha1_FileMapping is an autogenerated conversion function. -func Convert_ignite_FileMapping_To_v1alpha1_FileMapping(in *ignite.FileMapping, out *FileMapping, s conversion.Scope) error { - return autoConvert_ignite_FileMapping_To_v1alpha1_FileMapping(in, out, s) -} - -func autoConvert_v1alpha1_Image_To_ignite_Image(in *Image, out *ignite.Image, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_ImageStatus_To_ignite_ImageStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Image_To_ignite_Image is an autogenerated conversion function. -func Convert_v1alpha1_Image_To_ignite_Image(in *Image, out *ignite.Image, s conversion.Scope) error { - return autoConvert_v1alpha1_Image_To_ignite_Image(in, out, s) -} - -func autoConvert_ignite_Image_To_v1alpha1_Image(in *ignite.Image, out *Image, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_ignite_ImageStatus_To_v1alpha1_ImageStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_Image_To_v1alpha1_Image is an autogenerated conversion function. -func Convert_ignite_Image_To_v1alpha1_Image(in *ignite.Image, out *Image, s conversion.Scope) error { - return autoConvert_ignite_Image_To_v1alpha1_Image(in, out, s) -} - -func autoConvert_v1alpha1_ImageSpec_To_ignite_ImageSpec(in *ImageSpec, out *ignite.ImageSpec, s conversion.Scope) error { - // WARNING: in.OCIClaim requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_ignite_ImageSpec_To_v1alpha1_ImageSpec(in *ignite.ImageSpec, out *ImageSpec, s conversion.Scope) error { - // WARNING: in.OCI requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_ImageStatus_To_ignite_ImageStatus(in *ImageStatus, out *ignite.ImageStatus, s conversion.Scope) error { - if err := Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ImageStatus_To_ignite_ImageStatus is an autogenerated conversion function. -func Convert_v1alpha1_ImageStatus_To_ignite_ImageStatus(in *ImageStatus, out *ignite.ImageStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ImageStatus_To_ignite_ImageStatus(in, out, s) -} - -func autoConvert_ignite_ImageStatus_To_v1alpha1_ImageStatus(in *ignite.ImageStatus, out *ImageStatus, s conversion.Scope) error { - if err := Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_ImageStatus_To_v1alpha1_ImageStatus is an autogenerated conversion function. -func Convert_ignite_ImageStatus_To_v1alpha1_ImageStatus(in *ignite.ImageStatus, out *ImageStatus, s conversion.Scope) error { - return autoConvert_ignite_ImageStatus_To_v1alpha1_ImageStatus(in, out, s) -} - -func autoConvert_v1alpha1_Kernel_To_ignite_Kernel(in *Kernel, out *ignite.Kernel, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_KernelStatus_To_ignite_KernelStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Kernel_To_ignite_Kernel is an autogenerated conversion function. -func Convert_v1alpha1_Kernel_To_ignite_Kernel(in *Kernel, out *ignite.Kernel, s conversion.Scope) error { - return autoConvert_v1alpha1_Kernel_To_ignite_Kernel(in, out, s) -} - -func autoConvert_ignite_Kernel_To_v1alpha1_Kernel(in *ignite.Kernel, out *Kernel, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_ignite_KernelStatus_To_v1alpha1_KernelStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_Kernel_To_v1alpha1_Kernel is an autogenerated conversion function. -func Convert_ignite_Kernel_To_v1alpha1_Kernel(in *ignite.Kernel, out *Kernel, s conversion.Scope) error { - return autoConvert_ignite_Kernel_To_v1alpha1_Kernel(in, out, s) -} - -func autoConvert_v1alpha1_KernelSpec_To_ignite_KernelSpec(in *KernelSpec, out *ignite.KernelSpec, s conversion.Scope) error { - // WARNING: in.OCIClaim requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_ignite_KernelSpec_To_v1alpha1_KernelSpec(in *ignite.KernelSpec, out *KernelSpec, s conversion.Scope) error { - // WARNING: in.OCI requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_KernelStatus_To_ignite_KernelStatus(in *KernelStatus, out *ignite.KernelStatus, s conversion.Scope) error { - out.Version = in.Version - if err := Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_KernelStatus_To_ignite_KernelStatus is an autogenerated conversion function. -func Convert_v1alpha1_KernelStatus_To_ignite_KernelStatus(in *KernelStatus, out *ignite.KernelStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_KernelStatus_To_ignite_KernelStatus(in, out, s) -} - -func autoConvert_ignite_KernelStatus_To_v1alpha1_KernelStatus(in *ignite.KernelStatus, out *KernelStatus, s conversion.Scope) error { - out.Version = in.Version - if err := Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(&in.OCISource, &out.OCISource, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_KernelStatus_To_v1alpha1_KernelStatus is an autogenerated conversion function. -func Convert_ignite_KernelStatus_To_v1alpha1_KernelStatus(in *ignite.KernelStatus, out *KernelStatus, s conversion.Scope) error { - return autoConvert_ignite_KernelStatus_To_v1alpha1_KernelStatus(in, out, s) -} - -func autoConvert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource, out *ignite.OCIImageSource, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: inconvertible types (string vs *github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIContentID) - out.Size = in.Size - // WARNING: in.RepoDigests requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(in *ignite.OCIImageSource, out *OCIImageSource, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: inconvertible types (*github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIContentID vs string) - out.Size = in.Size - return nil -} - -func autoConvert_v1alpha1_Pool_To_ignite_Pool(in *Pool, out *ignite.Pool, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - if err := Convert_v1alpha1_PoolSpec_To_ignite_PoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_PoolStatus_To_ignite_PoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Pool_To_ignite_Pool is an autogenerated conversion function. -func Convert_v1alpha1_Pool_To_ignite_Pool(in *Pool, out *ignite.Pool, s conversion.Scope) error { - return autoConvert_v1alpha1_Pool_To_ignite_Pool(in, out, s) -} - -func autoConvert_ignite_Pool_To_v1alpha1_Pool(in *ignite.Pool, out *Pool, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - if err := Convert_ignite_PoolSpec_To_v1alpha1_PoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_ignite_PoolStatus_To_v1alpha1_PoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_Pool_To_v1alpha1_Pool is an autogenerated conversion function. -func Convert_ignite_Pool_To_v1alpha1_Pool(in *ignite.Pool, out *Pool, s conversion.Scope) error { - return autoConvert_ignite_Pool_To_v1alpha1_Pool(in, out, s) -} - -func autoConvert_v1alpha1_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_v1alpha1_PoolDevice_To_ignite_PoolDevice is an autogenerated conversion function. -func Convert_v1alpha1_PoolDevice_To_ignite_PoolDevice(in *PoolDevice, out *ignite.PoolDevice, s conversion.Scope) error { - return autoConvert_v1alpha1_PoolDevice_To_ignite_PoolDevice(in, out, s) -} - -func autoConvert_ignite_PoolDevice_To_v1alpha1_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_v1alpha1_PoolDevice is an autogenerated conversion function. -func Convert_ignite_PoolDevice_To_v1alpha1_PoolDevice(in *ignite.PoolDevice, out *PoolDevice, s conversion.Scope) error { - return autoConvert_ignite_PoolDevice_To_v1alpha1_PoolDevice(in, out, s) -} - -func autoConvert_v1alpha1_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_v1alpha1_PoolSpec_To_ignite_PoolSpec is an autogenerated conversion function. -func Convert_v1alpha1_PoolSpec_To_ignite_PoolSpec(in *PoolSpec, out *ignite.PoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PoolSpec_To_ignite_PoolSpec(in, out, s) -} - -func autoConvert_ignite_PoolSpec_To_v1alpha1_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_v1alpha1_PoolSpec is an autogenerated conversion function. -func Convert_ignite_PoolSpec_To_v1alpha1_PoolSpec(in *ignite.PoolSpec, out *PoolSpec, s conversion.Scope) error { - return autoConvert_ignite_PoolSpec_To_v1alpha1_PoolSpec(in, out, s) -} - -func autoConvert_v1alpha1_PoolStatus_To_ignite_PoolStatus(in *PoolStatus, out *ignite.PoolStatus, s conversion.Scope) error { - out.Devices = *(*[]*ignite.PoolDevice)(unsafe.Pointer(&in.Devices)) - return nil -} - -// Convert_v1alpha1_PoolStatus_To_ignite_PoolStatus is an autogenerated conversion function. -func Convert_v1alpha1_PoolStatus_To_ignite_PoolStatus(in *PoolStatus, out *ignite.PoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_PoolStatus_To_ignite_PoolStatus(in, out, s) -} - -func autoConvert_ignite_PoolStatus_To_v1alpha1_PoolStatus(in *ignite.PoolStatus, out *PoolStatus, s conversion.Scope) error { - out.Devices = *(*[]*PoolDevice)(unsafe.Pointer(&in.Devices)) - return nil -} - -// Convert_ignite_PoolStatus_To_v1alpha1_PoolStatus is an autogenerated conversion function. -func Convert_ignite_PoolStatus_To_v1alpha1_PoolStatus(in *ignite.PoolStatus, out *PoolStatus, s conversion.Scope) error { - return autoConvert_ignite_PoolStatus_To_v1alpha1_PoolStatus(in, out, s) -} - -func autoConvert_v1alpha1_SSH_To_ignite_SSH(in *SSH, out *ignite.SSH, s conversion.Scope) error { - out.Generate = in.Generate - out.PublicKey = in.PublicKey - return nil -} - -// Convert_v1alpha1_SSH_To_ignite_SSH is an autogenerated conversion function. -func Convert_v1alpha1_SSH_To_ignite_SSH(in *SSH, out *ignite.SSH, s conversion.Scope) error { - return autoConvert_v1alpha1_SSH_To_ignite_SSH(in, out, s) -} - -func autoConvert_ignite_SSH_To_v1alpha1_SSH(in *ignite.SSH, out *SSH, s conversion.Scope) error { - out.Generate = in.Generate - out.PublicKey = in.PublicKey - return nil -} - -// Convert_ignite_SSH_To_v1alpha1_SSH is an autogenerated conversion function. -func Convert_ignite_SSH_To_v1alpha1_SSH(in *ignite.SSH, out *SSH, s conversion.Scope) error { - return autoConvert_ignite_SSH_To_v1alpha1_SSH(in, out, s) -} - -func autoConvert_v1alpha1_VM_To_ignite_VM(in *VM, out *ignite.VM, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VMSpec_To_ignite_VMSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_VMStatus_To_ignite_VMStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_VM_To_ignite_VM is an autogenerated conversion function. -func Convert_v1alpha1_VM_To_ignite_VM(in *VM, out *ignite.VM, s conversion.Scope) error { - return autoConvert_v1alpha1_VM_To_ignite_VM(in, out, s) -} - -func autoConvert_ignite_VM_To_v1alpha1_VM(in *ignite.VM, out *VM, s conversion.Scope) error { - out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta - if err := Convert_ignite_VMSpec_To_v1alpha1_VMSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_ignite_VMStatus_To_v1alpha1_VMStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_ignite_VM_To_v1alpha1_VM is an autogenerated conversion function. -func Convert_ignite_VM_To_v1alpha1_VM(in *ignite.VM, out *VM, s conversion.Scope) error { - return autoConvert_ignite_VM_To_v1alpha1_VM(in, out, s) -} - -func autoConvert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(in *VMImageSpec, out *ignite.VMImageSpec, s conversion.Scope) error { - // WARNING: in.OCIClaim requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(in *ignite.VMImageSpec, out *VMImageSpec, s conversion.Scope) error { - // WARNING: in.OCI requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(in *VMKernelSpec, out *ignite.VMKernelSpec, s conversion.Scope) error { - // WARNING: in.OCIClaim requires manual conversion: does not exist in peer-type - out.CmdLine = in.CmdLine - return nil -} - -func autoConvert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(in *ignite.VMKernelSpec, out *VMKernelSpec, s conversion.Scope) error { - // WARNING: in.OCI requires manual conversion: does not exist in peer-type - out.CmdLine = in.CmdLine - return nil -} - -func autoConvert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(in *VMNetworkSpec, out *ignite.VMNetworkSpec, s conversion.Scope) error { - // WARNING: in.Mode requires manual conversion: does not exist in peer-type - out.Ports = *(*metav1alpha1.PortMappings)(unsafe.Pointer(&in.Ports)) - return nil -} - -func autoConvert_ignite_VMNetworkSpec_To_v1alpha1_VMNetworkSpec(in *ignite.VMNetworkSpec, out *VMNetworkSpec, s conversion.Scope) error { - out.Ports = *(*metav1alpha1.PortMappings)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_ignite_VMNetworkSpec_To_v1alpha1_VMNetworkSpec is an autogenerated conversion function. -func Convert_ignite_VMNetworkSpec_To_v1alpha1_VMNetworkSpec(in *ignite.VMNetworkSpec, out *VMNetworkSpec, s conversion.Scope) error { - return autoConvert_ignite_VMNetworkSpec_To_v1alpha1_VMNetworkSpec(in, out, s) -} - -func autoConvert_v1alpha1_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error { - if err := Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(&in.Image, &out.Image, s); err != nil { - return err - } - if err := Convert_v1alpha1_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_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(&in.Network, &out.Network, s); err != nil { - return err - } - out.CopyFiles = *(*[]ignite.FileMapping)(unsafe.Pointer(&in.CopyFiles)) - out.SSH = (*ignite.SSH)(unsafe.Pointer(in.SSH)) - return nil -} - -func autoConvert_ignite_VMSpec_To_v1alpha1_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error { - if err := Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(&in.Image, &out.Image, s); err != nil { - return err - } - // WARNING: in.Sandbox requires manual conversion: does not exist in peer-type - if err := Convert_ignite_VMKernelSpec_To_v1alpha1_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_v1alpha1_VMNetworkSpec(&in.Network, &out.Network, s); err != nil { - return err - } - // WARNING: in.Storage requires manual conversion: does not exist in peer-type - out.CopyFiles = *(*[]FileMapping)(unsafe.Pointer(&in.CopyFiles)) - out.SSH = (*SSH)(unsafe.Pointer(in.SSH)) - return nil -} - -func autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { - // WARNING: in.State requires manual conversion: does not exist in peer-type - out.IPAddresses = *(*metav1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) - if err := Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(&in.Image, &out.Image, s); err != nil { - return err - } - if err := Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(&in.Kernel, &out.Kernel, s); err != nil { - return err - } - return nil -} - -func autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { - // WARNING: in.Running requires manual conversion: does not exist in peer-type - // WARNING: in.Runtime requires manual conversion: does not exist in peer-type - // WARNING: in.StartTime requires manual conversion: does not exist in peer-type - out.IPAddresses = *(*metav1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) - if err := Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(&in.Image, &out.Image, s); err != nil { - return err - } - if err := Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(&in.Kernel, &out.Kernel, s); err != nil { - return err - } - return nil -} diff --git a/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index b55d9348c..000000000 --- a/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,443 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - net "net" - - metav1alpha1 "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" - 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 *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.OCIClaim = in.OCIClaim - 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.OCIClaim = in.OCIClaim - 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 *OCIImageClaim) DeepCopyInto(out *OCIImageClaim) { - *out = *in - out.Ref = in.Ref - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCIImageClaim. -func (in *OCIImageClaim) DeepCopy() *OCIImageClaim { - if in == nil { - return nil - } - out := new(OCIImageClaim) - 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 - out.Size = in.Size - if in.RepoDigests != nil { - in, out := &in.RepoDigests, &out.RepoDigests - *out = make([]string, len(*in)) - copy(*out, *in) - } - 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 *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.OCIClaim = in.OCIClaim - 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.OCIClaim = in.OCIClaim - 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(metav1alpha1.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 *VMSpec) DeepCopyInto(out *VMSpec) { - *out = *in - out.Image = in.Image - out.Kernel = in.Kernel - out.Memory = in.Memory - out.DiskSize = in.DiskSize - in.Network.DeepCopyInto(&out.Network) - 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.IPAddresses != nil { - in, out := &in.IPAddresses, &out.IPAddresses - *out = make(metav1alpha1.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) - } - } - } - 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 -} diff --git a/pkg/apis/ignite/v1alpha1/zz_generated.defaults.go b/pkg/apis/ignite/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 72c4b6b70..000000000 --- a/pkg/apis/ignite/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,41 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1alpha1 - -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(&Image{}, func(obj interface{}) { SetObjectDefaults_Image(obj.(*Image)) }) - scheme.AddTypeDefaultingFunc(&Kernel{}, func(obj interface{}) { SetObjectDefaults_Kernel(obj.(*Kernel)) }) - scheme.AddTypeDefaultingFunc(&Pool{}, func(obj interface{}) { SetObjectDefaults_Pool(obj.(*Pool)) }) - scheme.AddTypeDefaultingFunc(&VM{}, func(obj interface{}) { SetObjectDefaults_VM(obj.(*VM)) }) - return nil -} - -func SetObjectDefaults_Image(in *Image) { - SetDefaults_OCIImageClaim(&in.Spec.OCIClaim) -} - -func SetObjectDefaults_Kernel(in *Kernel) { - SetDefaults_OCIImageClaim(&in.Spec.OCIClaim) -} - -func SetObjectDefaults_Pool(in *Pool) { - SetDefaults_PoolSpec(&in.Spec) -} - -func SetObjectDefaults_VM(in *VM) { - SetDefaults_VMSpec(&in.Spec) - SetDefaults_OCIImageClaim(&in.Spec.Image.OCIClaim) - SetDefaults_VMKernelSpec(&in.Spec.Kernel) - SetDefaults_OCIImageClaim(&in.Spec.Kernel.OCIClaim) - SetDefaults_VMNetworkSpec(&in.Spec.Network) - SetDefaults_VMStatus(&in.Status) -} diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index 51e2656f9..cdbc43cb3 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -13,26 +13,6 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.FileMapping": schema_pkg_apis_ignite_v1alpha1_FileMapping(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.Image": schema_pkg_apis_ignite_v1alpha1_Image(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageSpec": schema_pkg_apis_ignite_v1alpha1_ImageSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageStatus": schema_pkg_apis_ignite_v1alpha1_ImageStatus(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.Kernel": schema_pkg_apis_ignite_v1alpha1_Kernel(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelSpec": schema_pkg_apis_ignite_v1alpha1_KernelSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelStatus": schema_pkg_apis_ignite_v1alpha1_KernelStatus(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim": schema_pkg_apis_ignite_v1alpha1_OCIImageClaim(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource": schema_pkg_apis_ignite_v1alpha1_OCIImageSource(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.Pool": schema_pkg_apis_ignite_v1alpha1_Pool(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolDevice": schema_pkg_apis_ignite_v1alpha1_PoolDevice(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolSpec": schema_pkg_apis_ignite_v1alpha1_PoolSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolStatus": schema_pkg_apis_ignite_v1alpha1_PoolStatus(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.SSH": schema_pkg_apis_ignite_v1alpha1_SSH(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VM": schema_pkg_apis_ignite_v1alpha1_VM(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMImageSpec": schema_pkg_apis_ignite_v1alpha1_VMImageSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMKernelSpec": schema_pkg_apis_ignite_v1alpha1_VMKernelSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMNetworkSpec": schema_pkg_apis_ignite_v1alpha1_VMNetworkSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMSpec": schema_pkg_apis_ignite_v1alpha1_VMSpec(ref), - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMStatus": schema_pkg_apis_ignite_v1alpha1_VMStatus(ref), "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2.BlockDeviceVolume": schema_pkg_apis_ignite_v1alpha2_BlockDeviceVolume(ref), "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2.FileMapping": schema_pkg_apis_ignite_v1alpha2_FileMapping(ref), "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2.Image": schema_pkg_apis_ignite_v1alpha2_Image(ref), @@ -66,655 +46,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA } } -func schema_pkg_apis_ignite_v1alpha1_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{ - Type: []string{"string"}, - Format: "", - }, - }, - "vmPath": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"hostPath", "vmPath"}, - }, - }, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - 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)", - Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageStatus"), - }, - }, - }, - Required: []string{"TypeMeta", "metadata", "spec", "status"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.ImageStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - "ociClaim": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"), - }, - }, - }, - Required: []string{"ociClaim"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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", - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"), - }, - }, - }, - Required: []string{"ociSource"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - 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)", - Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelStatus"), - }, - }, - }, - Required: []string{"TypeMeta", "metadata", "spec", "status"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.KernelStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - "ociClaim": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"), - }, - }, - }, - Required: []string{"ociClaim"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - Type: []string{"string"}, - Format: "", - }, - }, - "ociSource": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"), - }, - }, - }, - Required: []string{"version", "ociSource"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_OCIImageClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "OCIImageClaim defines a claim for importing an OCI image", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type defines how the image should be imported", - Type: []string{"string"}, - Format: "", - }, - }, - "ref": { - SchemaProps: spec.SchemaProps{ - Description: "Ref defines the reference to use when talking to the backend. This is most commonly the image name, followed by a tag. Other supported ways are $registry/$user/$image@sha256:$digest This ref is also used as ObjectMeta.Name for kinds Images and Kernels", - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"), - }, - }, - }, - Required: []string{"type", "ref"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.OCIImageRef"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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 ID (e.g. the Docker image ID)", - Type: []string{"string"}, - Format: "", - }, - }, - "size": { - SchemaProps: spec.SchemaProps{ - Description: "Size defines the size of the source in bytes", - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), - }, - }, - "repoDigests": { - SchemaProps: spec.SchemaProps{ - Description: "RepoDigests defines the image name as it was when pulled from a repository, and the digest of the image The format is $registry/$user/$image@sha256:$digest This field is unpopulated if the image used as the source has never been pushed to or pulled from a registry", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"id", "size"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolStatus"), - }, - }, - }, - Required: []string{"TypeMeta", "spec", "status"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), - }, - }, - "parent": { - SchemaProps: spec.SchemaProps{ - 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", - 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", - 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_v1alpha1_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", - 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", - 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", - 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", - 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", - 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_v1alpha1_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/v1alpha1.PoolDevice"), - }, - }, - }, - }, - }, - }, - Required: []string{"devices"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.PoolDevice"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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_v1alpha1_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{ - 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)", - Ref: ref("github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMStatus"), - }, - }, - }, - Required: []string{"TypeMeta", "metadata", "spec", "status"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMStatus", "github.com/weaveworks/libgitops/pkg/runtime.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_VMImageSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ociClaim": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"), - }, - }, - }, - Required: []string{"ociClaim"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_VMKernelSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ociClaim": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"), - }, - }, - "cmdLine": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"ociClaim"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageClaim"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_VMNetworkSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "mode": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.PortMapping"), - }, - }, - }, - }, - }, - }, - Required: []string{"mode"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.PortMapping"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMImageSpec"), - }, - }, - "kernel": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMKernelSpec"), - }, - }, - "cpus": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int64", - }, - }, - "memory": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), - }, - }, - "diskSize": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"), - }, - }, - "network": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMNetworkSpec"), - }, - }, - "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{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.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/v1alpha1.SSH"), - }, - }, - }, - Required: []string{"image", "kernel", "cpus", "memory", "diskSize", "network"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.FileMapping", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.SSH", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMImageSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMKernelSpec", "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.VMNetworkSpec", "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1.Size"}, - } -} - -func schema_pkg_apis_ignite_v1alpha1_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{ - "state": { - SchemaProps: spec.SchemaProps{ - 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", - }, - }, - }, - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"), - }, - }, - "kernel": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"), - }, - }, - }, - Required: []string{"state", "image", "kernel"}, - }, - }, - Dependencies: []string{ - "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1.OCIImageSource"}, - } -} - func schema_pkg_apis_ignite_v1alpha2_BlockDeviceVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/openapi/violations.txt b/pkg/openapi/violations.txt index fa4d4e360..54ab47793 100644 --- a/pkg/openapi/violations.txt +++ b/pkg/openapi/violations.txt @@ -1,11 +1,7 @@ -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,OCIImageSource,RepoDigests -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,PoolStatus,Devices -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CopyFiles API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,PoolStatus,Devices API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CopyFiles API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,VolumeMounts API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,Volumes -API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CPUs 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/meta/v1alpha1,DMID,index API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,OCIContentID,digest