Bug 2036940 - oc registry login fails if the file is empty or stdout
Summary: oc registry login fails if the file is empty or stdout
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.10
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.10.0
Assignee: Filip Krepinsky
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-04 13:34 UTC by Filip Krepinsky
Modified: 2022-03-11 18:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-11 18:15:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc issues 985 0 None open Login fails if target file is empty 2022-01-04 13:34:46 UTC
Github openshift oc pull 1011 0 None open Bug 2036940: allow empty files in oc registry login 2022-01-04 13:51:17 UTC

Description Filip Krepinsky 2022-01-04 13:34:23 UTC
Description of problem:

taken from upstream issue

Since #893, the command oc registry login --kubeconfig=aaa --to=bbb fails if the file bbb is empty:

+(utils.sh:530): write_pull_secret(): oc registry login --kubeconfig=/tmp/kubeconfig--0dZLmzoYmT --to=/tmp/pullsecret--Sm82grIvD0
info: Using registry public hostname registry.ci.openshift.org
error: 1 error occurred:
	* reading JSON file "/tmp/pullsecret--Sm82grIvD0": unmarshaling JSON at "/tmp/pullsecret--Sm82grIvD0": unexpected end of JSON input



Also, argument "-" doesnt't work for --registry-config / --to options 

How reproducible:
100


Expected results:
1. the file bbb should have valid credentials
2. It should be possible to write to stdout


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