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

added: make target to auto generate code #1603

Conversation

yashvardhan-kukreja
Copy link
Contributor

Related issue

closes #1602

What type of PR is this

/kind feature

Proposed changes

Checklist

Further comments

The first commit just adds the make auto-generate target
The second commit is the code after running make auto-generate over the current state of main branch.

@yashvardhan-kukreja
Copy link
Contributor Author

ptal @realshuting

@yashvardhan-kukreja
Copy link
Contributor Author

@realshuting a quick update, I researched on this a few days back and couldn't find any way to auto generate code for informer, client and lister. I even looked at the source code of kubernetes/controller-tools to see if it is addressing informer, client and listers somewhere but it isn't.

I even raised an issue, some days back, on kubernetes/controller-tools asking this doubt but nobody replied there as well.

So, I guys we can close this issue/pr for now as there doesn't seem any plausible way to auto-generate informer,client and lister's code via controller-gen

@realshuting
Copy link
Member

@realshuting a quick update, I researched on this a few days back and couldn't find any way to auto generate code for informer, client and lister. I even looked at the source code of kubernetes/controller-tools to see if it is addressing informer, client and listers somewhere but it isn't.

I even raised an issue, some days back, on kubernetes/controller-tools asking this doubt but nobody replied there as well.

So, I guys we can close this issue/pr for now as there doesn't seem any plausible way to auto-generate informer,client and lister's code via controller-gen

Sure, we can use the current tool to generate client code. But I also find this is useful to update deepcopy methods from a forked report, is it ready to merge?

@yashvardhan-kukreja
Copy link
Contributor Author

Sorry I didn't get you. Which forked report are you exactly talking about?

@realshuting
Copy link
Member

Sorry I didn't get you. Which forked report are you exactly talking about?

Ah my bad, I mean forked repo..

@yashvardhan-kukreja
Copy link
Contributor Author

yashvardhan-kukreja commented Feb 26, 2021

Sorry I didn't get you. Which forked report are you exactly talking about?

Ah my bad, I mean forked repo..

ohh, just to confirm, when you said "updating the deep copy methods from the forked repo", did u mean that we should still consider this PR (my forked repo) only for the */zz_generated.deecopy.go files (containing the auto generated deepcopy methods) ,and remove the Makefile related changes from the PR

If yes, then, yeah, I tested the auto-generated deepcopy methods in this PR and they are working fine.

@realshuting
Copy link
Member

Yes, I think we can also keep the make command to update deepcopy methods. Can we change to an explicit name, make deepcopy-autogen or similar?

@yashvardhan-kukreja
Copy link
Contributor Author

Yes, I think we can also keep the make command to update deepcopy methods. Can we change to an explicit name, make deepcopy-autogen or similar?

Agreed, I'll do that 👍🏼

…ubebuilder

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
@yashvardhan-kukreja yashvardhan-kukreja force-pushed the issue-1602/add-make-target-to-auto-generate-code branch from a60da0c to f12d055 Compare February 26, 2021 10:29
@realshuting realshuting removed the hold label Mar 1, 2021
@realshuting realshuting merged commit 6f15432 into kyverno:main Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a 'make' target to auto-generate kubebuilder's auto-generable code
2 participants