-
Notifications
You must be signed in to change notification settings - Fork 26
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 support for custom Api Versions in informers (#639) #713
Conversation
is it possible to add a test? |
done ! |
// Model's api-group prefix to kubernetes api-group | ||
private final Map<String, String> preBuiltApiGroups = new HashMap<>(); | ||
|
||
// Model's api-version midfix to kubernetes api-version | ||
private final List<String> preBuiltApiVersions = new ArrayList<>(); | ||
|
||
// This allows parsing custom (not included in kubernetes core) api versions | ||
private final Pattern customVersionParser = Pattern.compile("(V[a-z1-9]+)[A-Z]+[a-zA-Z0-9]+"); |
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.
Did you get this regex from somewhere or have you created it?
I saw that you said this are valid:
- V1MySettings
- V1alpha1Operation
what about:
- Vtest1Operation
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 actually created it myself based on all the CRDs I know from my previous experiences but looking slightly more for references, I just found this one: https://github.com/kubernetes/apimachinery/blob/master/pkg/util/version/version.go#L38
Do you think we should use 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.
Any update @n0tl3ss ?
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.
Hi @cambierr can you update the PR with the regex that you have mentioned.
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.
sure, done!
Thanks for the contribution! |
This adds the support of custom api versions to the informer library as discussed in #639