-
Notifications
You must be signed in to change notification settings - Fork 305
Proposal: user defined model version explicit converter #1211
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
Proposal: user defined model version explicit converter #1211
Conversation
|
@tg123 this seems fine to me. Do you think this is ready to merge? |
|
I am good. Please also add a nuget lib |
|
/lgtm I think it will "just work" because the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, tg123 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 |
|
sigh looks like it didn't, I will build/update this nuget manually. |
|
Ok, this is now pushed: https://www.nuget.org/packages/KubernetesClient.ModelConverter/10.1.4 |
The Problem
The k8s models now have
explicit converterfor converting model objects in different versions, e.g. V1 <-> V1beta1Typical usage is
V1X v1obj = (V1X)v1beta1objThe converter is based on AutoMapper and introduces the dependency to AutoMapper which stopped supporting
netstandard2.0. Removing the dependency would also make the sdk clean and more secure.In additional, seems the feature is barely used.
New Design
KubernetesClient.ModelConverterlib for those who want to use version converters and move AutoMapper to this lib.ModelVersionConverter.Converter = AutoMapperModelVersionConverter.Instance;to set Converter or it will throw an errorIModelVersionConverter. users could impl it and setModelVersionConverter.Converterto their own converter