-
Notifications
You must be signed in to change notification settings - Fork 364
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
Remove package-wide kubebuilder:validation:optional annotation #4674
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twz123
force-pushed
the
kubebuilder-no-optional
branch
from
June 25, 2024 21:43
8071bdf
to
05b8aa4
Compare
16 tasks
twz123
force-pushed
the
kubebuilder-no-optional
branch
3 times, most recently
from
June 28, 2024 11:10
229e2f7
to
d4e7a48
Compare
This pull request has merge conflicts that need to be resolved. |
twz123
force-pushed
the
kubebuilder-no-optional
branch
from
July 5, 2024 08:23
d4e7a48
to
6143056
Compare
This pull request has merge conflicts that need to be resolved. |
Convert the config to unstructured to be able to tweak the actual YAML. Remove the creationTimestamp from the output. Remove the omitempty flag from the NLLB enabled field, so that it's false value makes it into the output. Remove all the parts from the docs that don't show up in reality. Signed-off-by: Tom Wieczorek <[email protected]>
They had no effect on code generation, either because they repeated contextual defaults or because they weren't applicable per se. Signed-off-by: Tom Wieczorek <[email protected]>
Kubebuilder will deduce the optional attribute from the JSON annotations, if unspecified. Add all the missing omitempty JSON annotations for truly optional fields, which is the right choice in 99% of the cases anyway. Also add some missing default annotations along the way. Overall, this brings the CRDs more in sync to what k0s actually expects at runtime, while omitting the rendering of useless zero values in JSON/ YAML representations. Signed-off-by: Tom Wieczorek <[email protected]>
twz123
force-pushed
the
kubebuilder-no-optional
branch
from
July 10, 2024 14:49
6143056
to
62908f4
Compare
jnummelin
approved these changes
Jul 12, 2024
jnummelin
approved these changes
Jul 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Kubebuilder will deduce the optional attribute from the JSON annotations, if unspecified. Add all the missing omitempty JSON annotations for truly optional fields, which is the right choice in 99% of the cases anyway. Also add some missing default annotations along the way.
Overall, this brings the CRDs more in sync to what k0s actually expects at runtime, while omitting the rendering of useless zero values in JSON/ YAML representations.
Convert the config in
k0s config create
to unstructured to be able to tweak the actual YAML. Remove the creationTimestamp from the output. Remove all the parts from the docs that don't show up in reality.See:
Type of change
How Has This Been Tested?
Checklist: