-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Make Cluster topology controlPlane optional #5165
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
sbueringer:pr-make-topology-controlplane-optional
Sep 6, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -595,7 +595,6 @@ spec: | |
type: object | ||
required: | ||
- class | ||
- controlPlane | ||
- version | ||
type: object | ||
type: object | ||
|
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.
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 have no strong opinions, but TBH, I kind of like having
Because the topology actually gets a control plane, even if the users does not specify any field for it when doing kubectl apply.
What instead I don't like Is to have
when metadata are not provided, because they are optional (probably the same applies to md as well)
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.
My point was only that it's a bit awkward from a user perspective to be forced to provide an empty controlPlane object. But I also don't have strong opinions about that.
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'm also not sure if omitempty would also make sense in that case. I guess then the empty controlPlane struct wouldn't be added.
EDIT: adding omitempty doesn't change anything
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.
@fabriziopandini What should we do here?
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.
What if the controlPlane is managed, for example? Then even an empty topology for it doesn't make sense.
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 don't really have a strong opinion.
I just think if the struct is optional (and it is in any case, we don't need any values), then it's not a great UX to enforce that users provide an empty object. When I think about it a bit longer. I think we should maybe also make the field a pointer (same reason, because it's optional to provide it)
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.
Looking at the API conventions about optional vs required and comparing them with our structs leads to a bunch of new questions: optional vs required
Optional fields:
Required fields:
I see a lot of required fields (non-pointer) which have omitempty and other fields have
+optional
andomitempty
but are not a pointer.