-
Notifications
You must be signed in to change notification settings - Fork 303
Support for conversions between models of different versions #420
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 for conversions between models of different versions #420
Conversation
414523c
to
5b8c018
Compare
/assign brendandburns |
5b8c018
to
cd2e467
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this to support api call to lower version k8s server?
|
||
namespace k8s.Versioning | ||
{ | ||
public class KubernetesVersionComparer : IComparer<string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Version
?
you may want to reuse it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this to support api call to lower version k8s server?
Yes, there's an open PR for creating and installed CRDs from me. I've ran into this problem when installing into my test cluster which is actually using an older version of CRDs. I'm refactoring that code to be based on this one, and automatically do conversion based on server version. I'm partly blocked on that one until we figure out what to do with #417
|
||
internal static void GetKubernetesMaps(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.DisableConstructorMapping(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generated it in LinqPad, but few of these maps had to be manually realigned. I guess I can put the autogeneration logic where there are no conflicts into the gen project and augment it with manual maps for where there are conflicts.
1d2d1b8
to
9de5644
Compare
1004259
to
5e98f5a
Compare
Yes, it's good to go as far as I'm concerned |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, macsux The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The use of automapper allows ensuring that all field mappings are accounted for. This work is a precursor to introducing API methods that automatically select the endpoint and model based on the server k8s version.