-
Notifications
You must be signed in to change notification settings - Fork 890
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
Specify the provider manually. #1025
Specify the provider manually. #1025
Conversation
The process is done,can you help review,thank you. |
OK. on it. thanks. |
pkg/karmadactl/join.go
Outdated
@@ -134,6 +137,7 @@ func (j *CommandJoinOption) AddFlags(flags *pflag.FlagSet) { | |||
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.") | |||
flags.StringVar(&j.ClusterKubeConfig, "cluster-kubeconfig", "", | |||
"Path of the cluster's kubeconfig.") | |||
flags.StringVar(&j.ClusterProvider, "cluster-provider", "", "Cluster provider.") |
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.
flags.StringVar(&j.ClusterProvider, "cluster-provider", "", "Cluster provider.") | |
flags.StringVar(&j.ClusterProvider, "cluster-provider", "", "Provider of the joining cluster.") |
pkg/karmadactl/join.go
Outdated
@@ -278,7 +282,7 @@ func generateSecretInMemberCluster(clusterKubeClient kubeclient.Interface, clust | |||
return clusterSecret, nil | |||
} | |||
|
|||
func generateClusterInControllerPlane(controlPlaneConfig, clusterConfig *rest.Config, clusterName string, secret corev1.Secret) (*clusterv1alpha1.Cluster, error) { | |||
func generateClusterInControllerPlane(controlPlaneConfig, clusterConfig *rest.Config, clusterName string, provider string, secret corev1.Secret) (*clusterv1alpha1.Cluster, error) { |
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 concern the parameter list is a little bit too long, can we use the CommandJoinOption
?
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.
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.
Do I need to change this?
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.
Yes, we can use CommandJoinOption to pass parameter in this case.
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
cc @lonelyCZ |
Thank you @2hangchen , could you squash your commits to one? |
pkg/karmadactl/join.go
Outdated
@@ -303,7 +311,7 @@ func generateClusterInControllerPlane(controlPlaneConfig, clusterConfig *rest.Co | |||
controlPlaneKarmadaClient := karmadaclientset.NewForConfigOrDie(controlPlaneConfig) | |||
cluster, err := CreateClusterObject(controlPlaneKarmadaClient, clusterObj, false) | |||
if err != nil { | |||
return nil, fmt.Errorf("failed to create cluster object. cluster name: %s, error: %v", clusterName, err) | |||
return nil, fmt.Errorf("failed to create cluster object. cluster name: %s, error: %v", opts.ClusterProvider, err) |
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.
It should be opts.ClusterName
Ok, I'm working on it |
9938b80
to
29a92cc
Compare
Signed-off-by: Pilipalaca <[email protected]> change the params Signed-off-by: Pilipalaca <[email protected]>
29a92cc
to
0322139
Compare
Thanks, @2hangchen lgtm |
/approve Leave LGTM to @lonelyCZ (for try the robot command) |
[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 |
Thanks, @RainbowMango /lgtm |
Signed-off-by: Pilipalaca [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
In the clusterlist,provider is a display column,so it should be manuall specified when join a member cluster.After manually specifiying the provider,you can get the specified provider throuh apiserver.
Which issue(s) this PR fixes:
Fixes #1023
Special notes for your reviewer:
Join with provider,then get it from apiserver:
Does this PR introduce a user-facing change?: