Bug 1920427 - Need to update `oc login` help page since we don't support prompt interactively for the username
Summary: Need to update `oc login` help page since we don't support prompt interactive...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-26 10:10 UTC by zhou ying
Modified: 2021-02-24 15:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:56:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 717 0 None closed Bug 1920427: drop information about prompt for oc login 2021-02-09 09:58:39 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:56:27 UTC

Description zhou ying 2021-01-26 10:10:55 UTC
Description of problem:
The `oc login` help show: 
Options:
  -p, --password='': Password, will prompt if not provided
  -u, --username='': Username, will prompt if not provided
But now we don't support prompt interactively for the username. need to update the help page.

Version-Release number of selected component (if applicable):
[zhouying@dhcp-140-138 ~]$ oc version --client
Client Version: 4.7.0-0.nightly-2021-01-22-134922

How reproducible:
always

Steps to Reproduce:
1.`oc help -h` 


Actual results:
[zhouying@dhcp-140-138 ~]$ oc login -h
Log in to your server and save login for subsequent use
....
Options:
  -p, --password='': Password, will prompt if not provided
  -u, --username='': Username, will prompt if not provided


Expected results:
Delete the prompt info for username, since we don't support prompt interactively for it.

Additional info:

Comment 1 zhou ying 2021-01-26 10:23:43 UTC
Also for the description :
 The information required to login -- like username and password, a session token, or the server details -- can be
provided through flags. If not provided, the command will prompt for user input as needed.

Comment 2 Maciej Szulik 2021-01-26 12:44:45 UTC
(In reply to zhou ying from comment #1)
> Also for the description :
>  The information required to login -- like username and password, a session
> token, or the server details -- can be
> provided through flags. If not provided, the command will prompt for user
> input as needed.

That bit doesn't talk about username or password, and that other will be asked for if not provided with --username flag.
We also interactively ask for server URL and inform about certificate, so I'll leave that.

I'll change flag descriptions (both username and password) and fix the interactive example to include --username flag

Comment 4 zhou ying 2021-02-01 04:03:36 UTC
Confirmed with latest oc , the issue has fixed:

[root@dhcp-140-138 ~]# oc login -h
....
Usage:
  oc login [URL] [flags]

Examples:
  # Log in interactively
  oc login --username=myuser
  
  # Log in to the given server with the given certificate authority file
  oc login localhost:8443 --certificate-authority=/path/to/cert.crt
  
  # Log in to the given server with the given credentials (will not prompt interactively)
  oc login localhost:8443 --username=myuser --password=mypass

Options:
  -p, --password='': Password for server
  -u, --username='': Username for server


[root@dhcp-140-138 ~]# oc version --client 
Client Version: 4.7.0-202101300840.p0-ba6a9bd

Comment 7 errata-xmlrpc 2021-02-24 15:56:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.