-
Notifications
You must be signed in to change notification settings - Fork 1.6k
📖 (docs/tutorials): ensure all fields follow Kubernetes API conventions #4942
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
📖 (docs/tutorials): ensure all fields follow Kubernetes API conventions #4942
Conversation
camilamacedo86
commented
Jul 20, 2025
- Review the API specs
- Add the missing markers in order to comply with k8s api conventions
- Moving towards to allow us add KAL : Proposal: Integrate kube-api-linter into Kubebuilder via golangci-lint #4809
a4320fd to
abcd49d
Compare
|
This PR is the latest one to ensure that we follow all samples / scaffold and everything in the k8s API conventions and rules. If you have time to help with the reviews, it would be great! |
erikgb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mind if this is merged as is, but I find it inconsistent to remove +kubebuilder:validation:MinLength=0 and at the same time add +kubebuilder:validation:MinItems=0. Both are pretty redundant, since this is the default.
docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go
Outdated
Show resolved
Hide resolved
docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go
Outdated
Show resolved
Hide resolved
docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go
Outdated
Show resolved
Hide resolved
77f88f0 to
d2ee38d
Compare
|
Hi @erikgb, I tried to address your review. |
d2ee38d to
ad9c8a0
Compare
ad9c8a0 to
7cf2ea7
Compare
84b60f7 to
a3078c8
Compare
docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go
Outdated
Show resolved
Hide resolved
docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go
Outdated
Show resolved
Hide resolved
docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go
Outdated
Show resolved
Hide resolved
bb98572 to
c6e41ee
Compare
| obj = &batchv1.CronJob{ | ||
| Spec: batchv1.CronJobSpec{ | ||
| Schedule: schedule, | ||
| ConcurrencyPolicy: batchv1.AllowConcurrent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it not a pointer?
See: kubernetes-sigs/kube-api-linter#128
We will need to configure the linter with WhenRequired option
@erikgb @JoelSpeed
c6e41ee to
f1a6963
Compare
f1a6963 to
4c98bb2
Compare
|
Hi @JoelSpeed and @erikgb Thank you a lot for your help and support. It's hard sometimes to keep all in mind when we are doing many things at the same time. :-P But I really appreciate so much the help |
| spec: | ||
| properties: | ||
| concurrencyPolicy: | ||
| default: Allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed the context. Why it's allowed as default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the type: ConcurrencyPolicy
It can be:
enum:
- Allow
- Forbid
By default, in the example, we want to allow.
So, if not set will be Allow
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afzal442, camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
In this one, we addressed all comments made by @JoelSpeed and @erikgb |