Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Issues around Tanzu cli login command #1859

Open
thesteve0 opened this issue Mar 18, 2022 · 3 comments
Open

Issues around Tanzu cli login command #1859

thesteve0 opened this issue Mar 18, 2022 · 3 comments
Labels
area/cli area/core-cli area/ux UX related kind/bug PR/Issue related to a bug

Comments

@thesteve0
Copy link

Bug Report

The documentation tanzu login --help has issues in explaining how to use the command. The error message when the flags are not complete is unhelpful.

Expected Behavior

Help Documentation

If I have a .kube/config file that is properly configured and I want to use it to login to my management cluster I think this correspeonds to these example in the cli doc

 # Login to TKG management cluster by using kubeconfig path and context for the management cluster
        tanzu login --kubeconfig path/to/kubeconfig --context path/to/context --name mgmt-cluster

        # Login to TKG management cluster by using default kubeconfig path and context for the management cluster
        tanzu login  --context path/to/context --name mgmt-cluster
        

There is no "path" to a context to use in the config file. It is just a name that specifies which context corresponds to our management cluster. The current instructions confuses the user and makes them think that perhaps there is something else you are asking for

I think the help for --content should be

--context context-name

or

--context contextName

When the tanzu cli adds a context to a kube config file it typically names them

clustername-admin@clustername

If we want to make the assumption we created the context that people want to use, I would also be OK with making that the example name. I do not think that assumption holds but I just wanted to put it out there.

Error message

When I used this command I kept forgetting to put the --name at the end of the command and so the command failed. Unfortunately this is the error message that came back is this

> tanzu login --kubeconfig ~/.kube/config  --context management-admin@management
 failed to login to the management cluster management, unable to read kubeconfig

That config is the correct location for the config file and that is the right name of the context. The real problem is I didn't pass in a required parameter "--name". The error message should have said something like:

failed to provide required parameter --name
@thesteve0 thesteve0 added kind/bug PR/Issue related to a bug triage/needs-triage labels Mar 18, 2022
@stmcginnis stmcginnis transferred this issue from vmware-tanzu/community-edition Mar 18, 2022
@stmcginnis stmcginnis added needs-triage Indicates an issue or PR needs to be triaged and removed triage/needs-triage labels Mar 18, 2022
@github-actions
Copy link

Hey @thesteve0! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Tanzu Framework.

@thesteve0
Copy link
Author

It also turns out that the --name has to match the name of the cluster. I am not sure what "name" we need to match but my guess is the actual cluster name from the context. But I am confused why we need that when the information is already in the kube config file

@codegold79 codegold79 added area/cli area/ux UX related and removed needs-triage Indicates an issue or PR needs to be triaged labels Mar 31, 2022
@codegold79
Copy link
Contributor

I agree the help messages should be more helpful, so thank you, @thesteve0, for submitting this issue.

It also turns out that the --name has to match the name of the cluster.
Is the error the same as what was reported in #1859?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli area/core-cli area/ux UX related kind/bug PR/Issue related to a bug
Projects
None yet
Development

No branches or pull requests

4 participants