-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 singular resource names to discovery #43312
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deads2k
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
cde3468
to
6d906dd
Compare
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` | ||
// singular is the singular name of the resource. This allows clients to handle plural and singular opaquely. | ||
Singular string `json:"singular" protobuf:"bytes,6,opt,name=singular"` |
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 prefer "SingularName"
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.
+1
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` | ||
// singular is the singular name of the resource. This allows clients to handle plural and singular opaquely. |
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.
Add to documentation where the plural name is used vs where the singular name is used.
API change lgtm if you fix my comments. Are you planning on doing a second PR or adding the implementation to this one? |
Second PR. I may even see if I can con @p0lyn0mial into trying it :) |
@mbohlool is there a convenient place in OpenAPI to list this sort of metadata? |
lgtm with Let's also keep this in mind for TPRs. Now the kind and resource are linked, i.e. either singular or plural. |
6d906dd
to
980e350
Compare
980e350
to
36cb9ed
Compare
@k8s-bot cvm gce e2e test this |
Name updated. |
Generated and non-generated code are both in one commit that make it hard to review. |
// singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. | ||
// The singularName is more correct for reporting status on a single item and both singular and plural are allowed | ||
// from the kubectl CLI interface. | ||
SingularName string `json:"singularName" protobuf:"bytes,6,opt,name=singularName"` |
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.
@mbohlool only line of meat here.
Yep, I saw 54 files changes and was looking for some kind of implementation for this :). In future if we split the commits, it make it really easy to review. Regarding openapi, the implementation should also add a tag to openapi spec of that model. e.g., adding a |
Automatic merge from submit-queue (batch tested with PRs 43429, 43416, 43312, 43141, 43421) |
Adds the singular resource name to our resource for discovery. This is something we've discussed to remove our pseudo-pluralization library which is unreliable even for english and really has no hope of properly handling other languages or variations we can expect from TPRs and aggregated API servers.
This pull simply adds the information to discovery, it doesn't not re-wire any RESTMappers.
@kubernetes/sig-cli-misc @kubernetes/sig-apimachinery-misc @kubernetes/api-review