-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
customresourcestate: Use pluralize logic from k8s/apimachinery #2065
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrueg 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 |
But the pluralization logic in upstream k8s is super broken... |
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 does this solve?
Kubebuilder didn't opt to use upstream k8s pluralization logic because it was so wonky to begin with, so arguably this makes things worse.
For instance, |
@logicalhan I am aware that it's broken. At least it's somewhat deterministically broken instead of relying on flect to have a better heuristic (and also sometimes getting things wrong #2051). What are better options? |
PR needs rebase. 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. |
@mrueg how about using https://github.com/gertd/go-pluralize? overall we've observed some pluralize issues with |
That's doable, but there will always be a room for risk unless machinery and kubebuilder decide on the same pluralizing logic, which ideally should become the de-facto standard for generating resource names. |
That sound like the best way to avoid bugs caused by differences in naming. |
/triage accepted |
@dgrisonnet #2093 I think moving to GRV might make this obsolete |
Oh right, I need to catch up on that. Thanks for the update |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
What this PR does / why we need it:
kubernetes and kubebuilder use a different logic to generate / guess plurals. The goal of this PR is to use the same logic as Kubernetes.
Kubernetes: https://github.com/kubernetes/apimachinery/blob/master/pkg/api/meta/restmapper.go#L126
Kubebuilder: https://github.com/gobuffalo/flect
See also:
kubernetes-sigs/kubebuilder#3402
kubernetes-sigs/kubebuilder#3408
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
None
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):None