Description of problem: 1) oc extract –to doesn’t create the target directory if it’s not present 2) oc extract –to doesn’t check if the file provided is a directory $ oc extract secret/pull-secret -n openshift-config --confirm --to=/tmp/kkk error: stat /tmp/kkk: no such file or directory $ touch /tmp/kkk $ oc extract secret/pull-secret -n openshift-config --confirm --to=/tmp/kkk error: .dockerconfigjson: open /tmp/kkk/.dockerconfigjson: not a directory Version-Release number of selected component (if applicable): 4.10.0-0.nightly-2021-12-03-213835 How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: The command fails if the target directory is not present Expected results: For better user experience, we’d better have oc to create the target directory if it’s not present Additional info:
can't reproduce the issue now: [root@localhost ~]# ls /tmp [root@localhost ~]# oc extract secret/pull-secret -n openshift-config --confirm --to=/tmp/kkk /tmp/kkk/.dockerconfigjson [root@localhost ~]# ls /tmp kkk [root@localhost ~]# oc version client Client Version: 4.12.0-0.nightly-2022-10-18-192348 Kustomize Version: v4.5.7 Server Version: 4.12.0-0.nightly-arm64-2022-10-18-153953 Kubernetes Version: v1.25.2+5bf2e1f
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.12.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:7399