Comments (6)
Hi @jmeyers35,
Thank you for raising this one.
However, note that all documentation in kubebuilder is generated automatically via what is the doc in the source code of controller-tools. Therefore:
-
a) Can you please transfer this issue to the controller-tools repo. Your request cannot be addressed via Kubebuilder repo/code source or project
-
b) WDYT about open a pull request for controller-tools with the changes that you suggest. Therefore, when a new controller-tool release is made with it, the Kubebuilder docs will be updated.
Thank you for attention.
@vincepri @joelanford (could you please move this issue to controller-tools if the owner be unable to do so?)
from kubebuilder.
I'm happy to open a PR for this at some point, but I wanted to flag this in case someone can get around to it before I can. I also could've been a bit more specific - when I said "documentation", I really meant the book, which I believe is indeed in this repo. But this is probably worth noting in the generated docs as well.
from kubebuilder.
Hi @jmeyers35,
That is great. I see, the info that you would like to add in the docs is:
Update:
The omitempty tag in Foo stringjson:"foo,omitempty"
had more precedence than the kubebuilder marker +kubebuilder:validation:Required therefore making the resultant generated crd field to be optional.The +kubebuilder:validation:Required marker does works as desired when omitempty is not used.
I am not able to recall if docs(https://book.kubebuilder.io/) mentions it, but I hope it does.
With that I mark this issue to be closed.
Following some examples that I hope that help you:
-
If you want to update the info in: https://book.kubebuilder.io/reference/markers/crd-validation then, I belive that the change must to be in: https://github.com/kubernetes-sigs/controller-tools/blob/master/pkg/crd/markers/validation.go#L77
-
if you want to add something in https://book.kubebuilder.io/reference/markers.html?highlight=omitempty#markers-for-configcode-generation then, it lives in this repo.
Please feel free to open a PR with your suggestion on where you see that it should fit, and then we can move forward from there. Thank you for your collaboration 🥇
from kubebuilder.
Hi @jmeyers35
After share above the info to you, do you think that it still requiring further explanation?
Would you like to contribute with this one?
from kubebuilder.
Just an update, kubernetes-sigs/controller-tools#944 got merged, so now it is possible to use omitempty
with required
(which was previously not).
Do we still need to add some documentation around this to close this issue, or just update controller-tools
version used by kubebuilder to start using new behavior?
from kubebuilder.
the latter would work for me.
from kubebuilder.
Related Issues (20)
- Title: Storage Error and Duplicate Reconciliation Leading to Resource Synchronization Issue HOT 1
- Error to scaffold conversion webhooks HOT 4
- ERROR: Invalid or corrupt Go version HOT 1
- Evaludate and Apply Latest Lint Rules and Features HOT 5
- cannot be handled as a CronJob unknown field HOT 2
- docs/scaffold: reconciler client and its methods should be private HOT 3
- Support +enum tags in k8s APIs HOT 4
- [META - Phases]: Discontinue Kube RBAC Proxy in Default Kubebuilder Scaffolding HOT 4
- Add in the docs a link for the controller-runtime FAQ
- Implement e2e controller tests for the multi-version sample used in the docs HOT 1
- Use Upgrade Assistance to re-generate samples docs HOT 1
- Update the Multi-Version tutorial programatically when we run `make generate` HOT 4
- kubebuilder make install fails [again]: metadata.annotations: Too long HOT 1
- OpenAPI Schema Validation Errors for imagePullSecrets and hostAliases for CronjobTutorial sample with controller-runtime v0.18.3 and Kubernetes 1.30 HOT 3
- pull controller image failed HOT 2
- DNS Entry for book-v3 - We need figure out how to create it to publish the legacy docs HOT 1
- kustomize: strategicMergePatch clobbers patched arrays HOT 1
- GitHub page link update HOT 3
- RFE: Replace ServiceMonitor for PodMonitor HOT 3
- book.kubebuilder.io no longer reachable / dns record issing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubebuilder.