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 shortnames for endpointslices #117742
Add shortnames for endpointslices #117742
Conversation
Hi @hysyeah. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hysyeah The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/sig network |
This seems like it makes sense... we definitely use that abbreviation in places. /assign @robscott |
no other places that need modifications for shortname |
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 @hysyeah! This was an accidental omission so thanks for catching this.
|
||
// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource. | ||
func (r *REST) ShortNames() []string { | ||
return []string{"epslice"} |
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 think I'd prefer "eps" here. This would correspond with the "ep" used for Endpoints:
return []string{"ep"} |
For what it's worth, kubectl get eps
does not currently resolve in a Kubernetes cluster for me:
➜ ~ kubectl get eps
error: the server doesn't have a resource type "eps"
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 think I'd prefer "eps" here. This would correspond with the "ep" used for Endpoints
I changed it to "eps"
@@ -0,0 +1,51 @@ | |||
/* | |||
Copyright 2021 The Kubernetes Authors. |
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.
Copyright 2021 The Kubernetes Authors. | |
Copyright 2023 The Kubernetes Authors. |
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 corrected it
dd220f9
to
f585bcc
Compare
f585bcc
to
3b85974
Compare
Thanks @hysyeah! /lgtm |
LGTM label has been added. Git tree hash: e33e8450dbf32a26d2e035074954056c62e9bee2
|
I thought we had a general moratorium on new shortnames - do I misremember that, @liggitt ? |
I don't recall either way, but given they lead to ambiguous outcomes (see #117668) we should maybe discourage adding new official ones? |
also, endpointslices doesn't seem egregious to type out |
Yeah, I think the costs outweigh the benefits, unless we can ensure that no
2 resources use the same shortname.
…On Fri, May 12, 2023 at 8:58 AM Jordan Liggitt ***@***.***> wrote:
looks like #117535 <#117535>
and #116208 <#116208> just
merged adding more ... if we're unsure about adding new official
shortnames, we should revert those until we're sure this is a good direction
—
Reply to this email directly, view it on GitHub
<#117742 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKWAVDGEEVUYUKIGWOP7PTXFZMY3ANCNFSM6AAAAAAXUBVXNE>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Both autocomplete (already exists, used like cc @hysyeah @kkkkun @wojtek-t @jpbetz @MikeSpreitzer as authors/reviewers on the other PRs adding new shortnames to 1.28 in the last ~week |
/hold |
Shouldn’t shortnames be under api review? Is the issue the number of types we add, or colliding with ecosystem names? We can certainly have a higher bar for adding a short name, Names are egregious to type out, i can’t say i’ve typed anything but rs or sts in the last five years. I’m not sure many humans type mutatingwebhookconfigurstion and agree autocomplete handles the non core types. If it’s something you type all the time, a short name is an affordance for humans. Wish we had data on prevalence of use… |
Can we fail to load if we find conflicting shortnames?
…On Fri, May 12, 2023 at 3:59 PM Clayton Coleman ***@***.***> wrote:
Shouldn’t shortnames be under api review? Is the issue the number of types we add, or colliding with ecosystem names? We can certainly have a higher bar for adding a short name,
Names are egregious to type out, i can’t say i’ve typed anything but rs or sts in the last five years. I’m not sure many humans type mutatingwebhookconfigurstion and agree autocomplete handles the non core types. If it’s something you type all the time, a short name is an affordance for humans.
Wish we had data on prevalence of use…
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were assigned.Message ID: ***@***.***>
|
they definitely should be since they're API surface, but mechanically weren't because the implementation put the definition in
Poor behavior in collision cases, and that shortnames, aliases, and unqualified singular and plural resource names are all in the kubectl fuzzy matching bucket, so adding a CRD with an actual resource type of |
I … don't know… #117668 was exploring what to do in ambiguous situations … goals of being user friendly, safe, and compatible are sort of at odds here |
The shortnames "eps" does not colliding with other names. |
I agree we should add shortnames to kubectl. We should not change service define and should revert these. |
The inconsistency of available shortnames ( some {lengthy} types have , but not all) is not good as well. I think we should have clear definition /criteria on this. May be we have such requirement documented somewhere ? 🤔 , I failed to find though. |
If we are going to support client-side shortcuts, we should emit a message to that effect or even disallow aliases when running in a script (not 100% sure how to tell - there must be a way). Is there a KEP? e.g.
|
Do we have a place to document the moratorium? |
hmm, not a great place, but https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md didn't have anything about short names or categories, so opened kubernetes/community#7299 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add shortnames for endpointslices, better UX.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: