Create testdata sample for samples in the reference links #3974
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/feature
Categorizes issue or PR as related to a new feature.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
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
The text was updated successfully, but these errors were encountered: