Skip to content
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 kubebuilder shortName for work #3468

Merged
merged 1 commit into from
May 29, 2023

Conversation

yanfeng1992
Copy link
Member

@yanfeng1992 yanfeng1992 commented Apr 26, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

Consider adding a shortname to work? Because in our environment, I found that the resources of other teams are also called work. Is the name work too generic? Add a shortname to facilitate the distinction

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

API change:  Introduced short name `wk` for `Work` resource.

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 26, 2023
@karmada-bot karmada-bot requested review from Garrybest and Poor12 April 26, 2023 06:32
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 26, 2023
@RainbowMango
Copy link
Member

Because in our environment, I found that the resources of other teams are also called work.

Do you mean another CRD resource that Kind is Work? Does this happen in your production environment?

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2023

Codecov Report

Merging #3468 (5b0f710) into master (0f84dd7) will decrease coverage by 0.02%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #3468      +/-   ##
==========================================
- Coverage   53.76%   53.74%   -0.02%     
==========================================
  Files         210      210              
  Lines       19123    19118       -5     
==========================================
- Hits        10281    10275       -6     
- Misses       8290     8291       +1     
  Partials      552      552              
Flag Coverage Δ
unittests 53.74% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controllers/gracefuleviction/evictiontask.go 95.65% <ø> (-0.30%) ⬇️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@yanfeng1992
Copy link
Member Author

yanfeng1992 commented Apr 26, 2023

Do you mean another CRD resource that Kind is Work? Does this happen in your production environment?

another CRD resource that Kind

Because in our environment, I found that the resources of other teams are also called work.

Do you mean another CRD resource that Kind is Work? Does this happen in your production environment?

Yes, there will be problems with kubectl get work at this time. The alphabetical order of another crd is before the work of Karmada, so kubectl get work cannot query the work resources of Karmada @RainbowMango

@RainbowMango
Copy link
Member

Can you give an example to illustrate the problem?
What's the output of # kubectl get work?

@yanfeng1992
Copy link
Member Author

yanfeng1992 commented Apr 26, 2023

Can you give an example to illustrate the problem? What's the output of # kubectl get work?

image

@RainbowMango
Copy link
Member

Seems kubectl resolves work to privatedns.xxx.io/v1alpha1/works instead of works.work.karmada.io.

Is the name work too generic? Add a shortname to facilitate the distinction

The work API comes from kubernetes-sigs/work-api.

@RainbowMango
Copy link
Member

I'm hesitant to introduce a short name for Work, just as you said it's generic and simple.

I'm thinking if it is possible to add a short name to the privatedns.xxx.io/v1alpha1/works?

@yanfeng1992
Copy link
Member Author

yanfeng1992 commented Apr 26, 2023

I'm thinking if it is possible to add a short name to the privatedns.xxx.io/v1alpha1/works?

Adding a shortname to privatens.xxx.io/v1alpha1/works cannot solve this problem, and kubectl get work still cannot find works.work.karmada.io. The reason is as I said before, privatens.xxx.io/v1alpha1/works letter The order is before works.work.karmada.io. So I want to add wk shortname to works.work.karmada.io in our environment, or use kubectl get work.wrok to query works.work.karmada.io (this is somewhat not very convenient).

I'm hesitant to introduce a short name for Work, just as you said it's generic and simple.

Yes, because it is generic and simple, other crds may also use this name

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 26, 2023
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
@karmada-bot karmada-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 26, 2023
@RainbowMango
Copy link
Member

Adding a shortname to privatens.xxx.io/v1alpha1/works cannot solve this problem, and kubectl get work still cannot find works.work.karmada.io.

Assuming the short name of privatedns.xxx.io/v1alpha1/works is wk, then you can get the private work by kubect get wk, isn't it?

The reason is as I said before, privatens.xxx.io/v1alpha1/works letter The order is before works.work.karmada.io.

Do you mean the kubectl resolves the resource type by alphabetic order? Since privatens.xxx.io/v1alpha1/works is prior to works.work.karmada.io, Karmada's Work will be ignored by default. Am I right?

@yanfeng1992
Copy link
Member Author

yanfeng1992 commented Apr 26, 2023

Adding a shortname to privatens.xxx.io/v1alpha1/works cannot solve this problem, and kubectl get work still cannot find works.work.karmada.io.

Assuming the short name of privatedns.xxx.io/v1alpha1/works is wk, then you can get the private work by kubect get wk, isn't it?

yes, i can get the privatedns.xxx.io/v1alpha1/works work by kubectl get wk orkubectl get work , but I still can't get works.work.karmada.io through kubectl get work

The reason is as I said before, privatens.xxx.io/v1alpha1/works letter The order is before works.work.karmada.io.

Do you mean the kubectl resolves the resource type by alphabetic order? Since privatens.xxx.io/v1alpha1/works is prior to works.work.karmada.io, Karmada's Work will be ignored by default. Am I right?

yes, Karmada's Work will be ignored by default

@RainbowMango
Copy link
Member

I get it. You have to use kubectl get works.work.karmada.io to get the Karmada Works. cc @lonelyCZ for comments.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, are you using Karmada in production now?

@yanfeng1992
Copy link
Member Author

By the way, are you using Karmada in production now?

We are already supporters of karmada now. I and @whitewindmills are from a team

@lonelyCZ
Copy link
Member

here will be problems with kubectl get work at this time. The alphabetical order of another crd is before the work of Karmada, so kubectl get work cannot query the work resources of Karmada

If the privatens.xxx.io/v1alpha1/works also is set a short name wk, what would happend?

@yanfeng1992
Copy link
Member Author

If the privatens.xxx.io/v1alpha1/works also is set a short name wk, what would happend?

In this case

Will still get the privatens.xxx.io/v1alpha1/works. Karmada's Work will be ignored by default

@RainbowMango RainbowMango added this to the v1.6 milestone May 4, 2023
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 29, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 29, 2023
@karmada-bot karmada-bot merged commit 1e7ab93 into karmada-io:master May 29, 2023
@yanfeng1992 yanfeng1992 deleted the work-shortname branch April 2, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants