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 support for custom Api Versions in informers (#639) #713

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

cambierr
Copy link
Contributor

@cambierr cambierr commented Jun 9, 2024

This adds the support of custom api versions to the informer library as discussed in #639

@CLAassistant
Copy link

CLAassistant commented Jun 9, 2024

CLA assistant check
All committers have signed the CLA.

@graemerocher
Copy link
Contributor

is it possible to add a test?

@cambierr
Copy link
Contributor Author

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]+");
Copy link
Member

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

Copy link
Contributor Author

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any update @n0tl3ss ?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, done!

@graemerocher graemerocher merged commit 7239adf into micronaut-projects:6.2.x Jul 19, 2024
14 checks passed
@graemerocher
Copy link
Contributor

Thanks for the contribution!

@graemerocher graemerocher added the type: enhancement New feature or request label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants