Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the Convertible interface on resources and object types #1533

Closed
wants to merge 49 commits into from

Conversation

theunrepentantgeek
Copy link
Member

Builds on the property assignment functions already being generated to implement the ConvertTo() and ConvertFrom() methods required by the conversions.Convertible interface required by the controlle runtime.

Closes #1478

What this PR does / why we need it:

Implementation of Convertible is required to allow conversion of custom resources between the nominated hub storage type and the versions requsted by consumers.

How does this PR make you feel:
gif

If applicable:

  • this PR contains tests

@theunrepentantgeek theunrepentantgeek self-assigned this May 31, 2021
@theunrepentantgeek theunrepentantgeek added this to the codegen-alpha-1 milestone May 31, 2021
@theunrepentantgeek theunrepentantgeek force-pushed the feature/conversion-functions branch 2 times, most recently from 0b1cf72 to 15d53c3 Compare May 31, 2021 22:19
Copy link
Member

@babbageclunk babbageclunk left a comment

Choose a reason for hiding this comment

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

This looks great! The golden files only have the change removing storage version - presumably there's another change that will tie this implementation in so the conversion functions will be in them?

hack/generator/pkg/astbuilder/builder.go Outdated Show resolved Hide resolved
hack/generator/pkg/astbuilder/builder.go Show resolved Hide resolved
hack/generator/pkg/codegen/storage/storage_type_factory.go Outdated Show resolved Hide resolved
hack/generator/pkg/codegen/storage/storage_type_factory.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/astbuilder/builder.go Outdated Show resolved Hide resolved
hack/generator/pkg/astmodel/hub_function.go Show resolved Hide resolved
hack/generator/pkg/astmodel/hub_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/astmodel/hub_function.go Show resolved Hide resolved
hack/generator/pkg/astmodel/hub_function.go Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
hack/generator/pkg/conversions/hub_conversion_function.go Outdated Show resolved Hide resolved
@theunrepentantgeek theunrepentantgeek force-pushed the feature/conversion-functions branch 3 times, most recently from 8a5d3d7 to 9eebbf9 Compare June 14, 2021 03:03
@theunrepentantgeek theunrepentantgeek force-pushed the feature/conversion-functions branch from 632f9a5 to 1f957d6 Compare June 27, 2021 03:06
@theunrepentantgeek theunrepentantgeek force-pushed the feature/conversion-functions branch from 1f957d6 to 3568843 Compare June 27, 2021 20:46
@theunrepentantgeek theunrepentantgeek marked this pull request as draft June 28, 2021 22:18
@theunrepentantgeek theunrepentantgeek force-pushed the feature/persist-apiversions branch from f36dd42 to d2da249 Compare June 30, 2021 08:16
@theunrepentantgeek theunrepentantgeek force-pushed the feature/persist-apiversions branch from 6d73203 to 7319ad2 Compare July 5, 2021 04:19
@theunrepentantgeek theunrepentantgeek force-pushed the feature/persist-apiversions branch from 74e3f6f to 3be33df Compare July 7, 2021 01:42
Base automatically changed from feature/persist-apiversions to master July 7, 2021 01:59
@theunrepentantgeek theunrepentantgeek mentioned this pull request Jul 12, 2021
5 tasks
@theunrepentantgeek
Copy link
Member Author

Closing this, as discussed, now that everything useful has been harvested.

@theunrepentantgeek theunrepentantgeek deleted the feature/conversion-functions branch August 5, 2021 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Generate storage conversion functions
3 participants