-
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
📖 Add API conventions #5304
📖 Add API conventions #5304
Conversation
007b384
to
ac3cc96
Compare
The comment and definition for Replicas field for scalable resources i.e MachineDeployments, MachineSets, MachinePools seems misguiding. I know we discussed this in the past. But since we are here probably worth using the chance to discuss before promoting to beta. I think all ours scalable resources replicas should probably be commented an specified as:
|
@enxebre It's already enough if the field is either a pointer or it has I suspect it is a pointer so that client in controllers can explicitly not set it and an auto-scaler can take over (without the controller overwriting it again in the next reconciliation). |
ac3cc96
to
1582f78
Compare
Signed-off-by: Stefan Büringer [email protected]
1582f78
to
3b96e19
Compare
Conceptually this field should no be optional, do we agree? So I think it should be required and defaulted with no pointer:
Or if we foresee an issue with that, at minimum we should drop the misguiding comment ("// This is a pointer to distinguish between explicit zero and unspecified.") and make sure we are consistent in MachinePools and add the default marker. i.e:
Not sure I can think of case where the above would be problematic. |
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.
thanks for writing this up
/lgtm
/assign @randomvariable |
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.
/lgtm
/lgtm |
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.
/lgtm
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
What this PR does / why we need it:
This PR adds API conventions to establish a standard for our APIs going forward. The main focus is optional fields.
Related PRs:
+required
annotations, because they are not handled by controller-toolsomitempty
forLastTransitionTime
which makes the field required in OpenAPI Schema as intended+optional
to all optional fields which currently only haveomitempty
. This doesn't have any consequences as those fields already have been optional in the OpenAPI schema before (because of theomitempty
)omitempty
to some of our+optional
fieldsomitempty
from our object lifecycle boolean status fields and our replica counter status fields so they are always visible (e.g. viakubectl get
)Notes:
omitempty
and+optional
with the exception of:CONTRIBUTING.md
)Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Implements parts of #5239