Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Rename .spec.image.ociClaim.ref to .spec.image.oci for simplicity #311

Merged
merged 6 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions pkg/apis/ignite/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,103 @@ func Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource
out.ID, err = meta.ParseOCIContentID(contentRef)
return
}

// 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
}

// Convert between the old and new OCI reference format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe create a Convert_v1alpha1_OCIClaim_To_ignite_OCI(in *OCIClaim, out *meta.OCIImageRef) error and vice-versa which you can call in all these higher-context functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9d6ab9e.

out.OCIClaim.Ref = in.OCIRef
out.OCIClaim.Type = ImageSourceTypeDocker

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIRef = in.OCIClaim.Ref
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd comment specifically here that in.OCIClaim.Type is ignored on purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added that comment to Convert_v1alpha1_OCIClaim_To_ignite_OCI in 9d6ab9e.


return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIClaim.Ref = in.OCIRef
out.OCIClaim.Type = ImageSourceTypeDocker

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIRef = in.OCIClaim.Ref

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIClaim.Ref = in.OCIRef
out.OCIClaim.Type = ImageSourceTypeDocker

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIRef = in.OCIClaim.Ref

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIClaim.Ref = in.OCIRef
out.OCIClaim.Type = ImageSourceTypeDocker

return nil
}

// 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
}

// Convert between the old and new OCI reference format
out.OCIRef = in.OCIClaim.Ref

return nil
}
144 changes: 48 additions & 96 deletions pkg/apis/ignite/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.