Open camilamacedo86 opened 2 months ago
I would like to work on this !
@BalaadityaPatanjali Are you working on this issue?
@BalaadityaPatanjali Are you working on this issue?
No, you can work on it !
okay @BalaadityaPatanjali
@BalaadityaPatanjali Are you working on this issue?
No, you can work on it !
What do you want to happen?
Context:
In the hack/ dir we have a code that generate the samples and then add the code on top of this, see:
a) Use kubebuilder CLI bin with the latest changes to re-generate the samples, see for example the code used to re-generate the cronjob sample used in its tutorial (https://book.kubebuilder.io/cronjob-tutorial/cronjob-tutorial): https://github.com/kubernetes-sigs/kubebuilder/blob/master/hack/docs/internal/cronjob-tutorial/generate_cronjob.go#L66-L94
b) Replace/Add the code for the example on top, see for example that we have a file with consts for each part: https://github.com/kubernetes-sigs/kubebuilder/blob/master/hack/docs/internal/cronjob-tutorial/webhook_implementation.go and then we use the utils commands to insert/replace the content like here: https://github.com/kubernetes-sigs/kubebuilder/blob/master/hack/docs/internal/cronjob-tutorial/generate_cronjob.go#L146-L231
Problem that we want to solve
The code under references in the docs are not in samples generate with real projects which means they are not tested and can easily get outdated.
How we want to solve
We would like to have a sample testdata that is generated and we can use the code. We might could have a controller-per reference instead of one project for each reference.
ALso, by doing that we can test out the sample for each PR which will help us out ensure that all still valid when we update and move forward.
Example: See https://kubebuilder.io/reference/watching-resources/externally-managed
This sample could be in a project and we could indeed test it out with e2e tests.
Extra Labels
No response