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

Support manually-created and generated conversion functions #7832

Merged

Conversation

wojtek-t
Copy link
Member

@wojtek-t wojtek-t commented May 6, 2015

Part of #6800

This was mentioned in #7556 (comment)
Motivated by #7814, where a lot of unnecessary boilerplate had to be written.

cc @smarterclayton @lavalamp @fgrzadkowski

@smarterclayton
Copy link
Contributor

Test case that proves a generated conversion is overriden?

@wojtek-t wojtek-t force-pushed the separate_generated_conversion branch from fb53234 to 458fec6 Compare May 6, 2015 14:43
@wojtek-t
Copy link
Member Author

wojtek-t commented May 6, 2015

Test case that proves a generated conversion is overriden?

Good point - test added.
PTAL

@mbforbes
Copy link
Contributor

mbforbes commented May 6, 2015

Without digging into the code, I'm assuming the motivation sprung from #7343 (of which #7814 is the un-revert), and so @erictune and @pmorie are good candidates for review. Assigning to @pmorie for now; please feel free to shuffle around.

@smarterclayton
Copy link
Contributor

I'm going to grab this

@smarterclayton
Copy link
Contributor

LGTM

@smarterclayton smarterclayton added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2015
@wojtek-t
Copy link
Member Author

wojtek-t commented May 6, 2015

Thanks @smarterclayton !

I think that it would be good for @lavalamp to also take a look into it.

smarterclayton added a commit that referenced this pull request May 6, 2015
Support manually-created and generated conversion functions
@smarterclayton smarterclayton merged commit 800de8c into kubernetes:master May 6, 2015
// used if recursive conversion calls are desired). It must return an error.
//
// Example:
// c.RegisteConversionFunc(
Copy link
Member

Choose a reason for hiding this comment

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

nit: missing r

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix that in a subsequenct PR

@lavalamp
Copy link
Member

lavalamp commented May 6, 2015

Thanks for fixing this!

@thockin
Copy link
Member

thockin commented May 6, 2015

Is there somewhere I can read an overview of this changeset? I was very familiar with the state before autogeneration, and I want to understand what this is buying us and how I interact with it for manual conversion functions...

@lavalamp
Copy link
Member

lavalamp commented May 6, 2015

@thockin see the list of PRs on the end of #6800. This is an... expedient... way to cut the reflection out of the critical path so we can meet our performance goals. I think we can probably come up with a more user friendly mechanism but that's going to have to be post 1.0.

@lavalamp
Copy link
Member

lavalamp commented May 6, 2015

The overview is that we're autogenerating conversion functions--while allowing manual override--instead of using the conversion logic.

@thockin
Copy link
Member

thockin commented May 6, 2015

As an occasional author of manual conversion functions, what has changed
for me?

On Wed, May 6, 2015 at 3:49 PM, Daniel Smith notifications@github.com
wrote:

The overview is that we're autogenerating conversion functions--while
allowing manual override--instead of using the conversion logic.


Reply to this email directly or view it on GitHub
#7832 (comment)
.

@lavalamp
Copy link
Member

lavalamp commented May 6, 2015

@wojtek-t can confirm (and we'll want to write this up really soon), but I believe the steps will be:

  1. Move the auto-generated function from the list in newer.Scheme.AddGeneratedConversionFuncs(...) to the list in newer.Scheme.AddConversionFuncs(...) (soon: move the body of the function out of the file containing the auto-generated functions)
  2. Edit it.
  3. Regenerate the conversion functions.

@smarterclayton
Copy link
Contributor

I did this today for the etcd portal ip allocator and was easy (not quite fully documented yet).

On May 6, 2015, at 7:44 PM, Daniel Smith notifications@github.com wrote:

@wojtek-t can confirm (and we'll want to write this up really soon), but I believe the steps will be:

Move the auto-generated function from the list in newer.Scheme.AddGeneratedConversionFuncs(...) to the list in newer.Scheme.AddConversionFuncs(...) (soon: move the body of the function out of the file containing the auto-generated functions)
Edit it.
Regenerate the conversion functions.

Reply to this email directly or view it on GitHub.

@wojtek-t
Copy link
Member Author

wojtek-t commented May 7, 2015

Yes - this is exactly what @lavalamp wrote above. There is one more significant PR #7556 that will come (it's already under review) and as soon as it's in I will update documentation.
I already kind of updated it at some point (docs/devel/api_changes.md), but I agree it's again outdated :)

@wojtek-t wojtek-t deleted the separate_generated_conversion branch May 15, 2015 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants