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

Karmadactl join: default use current context #2956

Merged

Conversation

helen-frank
Copy link
Contributor

@helen-frank helen-frank commented Dec 13, 2022

Signed-off-by: helen haitao.zhang@daocloud.io

What type of PR is this?
/kind feature

What this PR does / why we need it:
The current context should be used instead of the clustername when the --cluster-context parameter is not set.
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
When I don't want to provide the--cluster-context parameter and encounter obstacles customizing the clustername, clustername become the --cluster-context, but I don't have such a context.
Does this PR introduce a user-facing change?:

`karmadactl`: The `--cluster-context` flag of `join` command now takes `current-context` by default.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 13, 2022
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 13, 2022
@helen-frank
Copy link
Contributor Author

A little idea, maybe we can use the name of the current context to join the karmada when the clustername is not filled in.

@helen-frank
Copy link
Contributor Author

/retest

@codecov-commenter
Copy link

Codecov Report

Merging #2956 (2e9b1d0) into master (796de42) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2956   +/-   ##
=======================================
  Coverage   38.32%   38.32%           
=======================================
  Files         207      207           
  Lines       18999    18999           
=======================================
  Hits         7282     7282           
- Misses      11287    11288    +1     
+ Partials      430      429    -1     
Flag Coverage Δ
unittests 38.32% <ø> (ø)

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

Impacted Files Coverage Δ
pkg/search/proxy/store/util.go 92.41% <0.00%> (-1.43%) ⬇️
pkg/util/worker.go 71.42% <0.00%> (+4.76%) ⬆️

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

@karmada-bot karmada-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 14, 2022
flags.StringVar(&j.ClusterContext, "cluster-context", "",
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
"Context name of cluster in kubeconfig. Please make sure this context exists in the cluster, default use current context.")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Context name of cluster in kubeconfig. Please make sure this context exists in the cluster, default use current context.")
"Name of cluster context in kubeconfig. The current context is used by default.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, but my e2e cannot pass. I'll check it later.

Copy link
Member

Choose a reason for hiding this comment

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

It seems we also need to update the e2e, because it using the old process.

Signed-off-by: helen <haitao.zhang@daocloud.io>
@karmada-bot karmada-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 16, 2022
@helen-frank helen-frank requested review from lonelyCZ and removed request for carlory December 16, 2022 09:47
@lonelyCZ
Copy link
Member

/lgtm

It could resolve some confusion of new users that don't unfamiliar the relationship between cluster name and cluster context.

/cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2022
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.

/approve

I updated the release-note.

@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 Dec 23, 2022
@karmada-bot karmada-bot merged commit c8954de into karmada-io:master Dec 23, 2022
@lonelyCZ
Copy link
Member

I updated the release-note.

Hi @RainbowMango , it should be join command.

karmadactl: The --cluster-context flag of init command now takes current-context by default.

to

karmadactl: The --cluster-context flag of join command now takes current-context by default.

@RainbowMango
Copy link
Member

oh, right.

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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants