Bug 2093797
| Summary: | 'oc registry login' with serviceaccount function need update | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | XiuJuan Wang <xiuwang> |
| Component: | oc | Assignee: | Maciej Szulik <maszulik> |
| oc sub component: | oc | QA Contact: | zhou ying <yinzhou> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | high | ||
| Priority: | high | CC: | mfojtik |
| Version: | 4.11 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.11.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-08-10 11:16:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
XiuJuan Wang
2022-06-06 06:00:20 UTC
Using -z has prompt the deprecated info. ./oc registry login -z default --to=/tmp/config.json Flag --service-account has been deprecated, and will be removed in the future version. Use oc create token instead. error: the service account default had no valid secrets associated with it the --service-account flag has been removed from the login help :
oc registry login -h
Log in to the OpenShift integrated registry.
This logs your local Docker client into the OpenShift integrated registry using the external registry name (if
configured by your administrator). If you are logged in to the server using a client certificate the command will report
an error because container registries do not generally allow client certificates.
As an advanced option you may specify the credentials to login with using --auth-basic with USER:PASSWORD.
You may specify an alternate file to write credentials to with --to instead of .docker/config.json in your home
directory. If you pass --to=- the file will be written to standard output.
To detect the registry hostname the client will attempt to find an image stream in the current namespace or the
openshift namespace and use the status fields that indicate the registry hostnames. If no image stream is found or if
you do not have permission to view image streams you will have to pass the --registry flag with the desired host name.
You may also pass the --registry flag to login to the integrated registry but with a custom DNS name, or to an external
registry. Note that in absence of --auth-basic=USER:PASSWORD, the authentication token from the connected kubeconfig
file will be recorded as the auth entry in the credentials file (defaults to Docker config.json) for the passed registry
value.
Experimental: This command is under active development and may change without notice.
Examples:
# Log in to the integrated registry
oc registry login
# Log in to different registry using BASIC auth credentials
oc registry login --registry quay.io/myregistry --auth-basic=USER:PASS
Options:
--auth-basic='':
Provide credentials in the form 'user:password' to authenticate (advanced)
--insecure=false:
Bypass HTTPS certificate verification when checking the registry login.
--registry='':
An alternate domain name and port to use for the registry, defaults to the cluster's configured external
hostname.
-a, --registry-config='':
The location of the file your credentials will be stored in. Alternatively REGISTRY_AUTH_FILE env variable can
be also specified. Defaults to ~/.docker/config.json. Default can be changed via REGISTRY_AUTH_PREFERENCE env
variable to docker (current default - deprecated) or podman (prioritizes podman credentials over docker).
--skip-check=false:
Skip checking the credentials against the registry.
--to='':
The location of the file your credentials will be stored in. Alternatively REGISTRY_AUTH_FILE env variable can
be also specified. Default is Docker config.json (deprecated). Default can be changed via
REGISTRY_AUTH_PREFERENCE env variable to docker or podman.
Usage:
oc registry login [flags] [options]
Use "oc options" for a list of global command-line options (applies to all commands).
oc version --client
Client Version: 4.11.0-0.nightly-2022-06-14-032134
Kustomize Version: v4.5.4
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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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-2022:5069 |