Bug 1921281
| Summary: | oc get -o yaml --export returns "error: unknown flag: --export" | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Tony Garcia <antgarci> |
| Component: | oc | Assignee: | Maciej Szulik <maszulik> |
| Status: | CLOSED ERRATA | QA Contact: | RamaKasturi <knarra> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.6.z | CC: | aos-bugs, jokerman, knarra, mfojtik |
| Target Milestone: | --- | ||
| Target Release: | 4.7.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-02-24 15:56:44 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
Tony Garcia
2021-01-27 20:25:58 UTC
(In reply to Tony Garcia from comment #0) > Document URL: > https://docs.openshift.com/container-platform/4.6/openshift_images/using- > templates.html#templates-create-from-existing-object_using-templates Apologies, the document is wrong, --export was removed in 4.6 I've opened a PR https://github.com/openshift/openshift-docs/pull/28907 to update our docs accordingly. > Describe the issue: > Customer is attempting to backup projects/namespaces by using the --export > flag. This was possible in 3.x. When executing this in 4.6, we receive the > following error: > oc get -o yaml --export all > cluster.yml > Error: unknown flag: --export > See 'oc get --help' for usage. > > Is there a better way to export projects/namespaces other then exporting > existing data into templates? > > For example: > oc get -o yaml secrets -n <namespace> --template= > secrets.yml > oc get -o yaml configmap -n <namespace> --template= > cm.yml > oc create -f secrets.yml (in new cluster env) > oc create -f cm.yml (in new cluster env) There is no automated way transcoding resources from server to templates, although I assume it's doable. The reason we've removed --export flag is that the requirements of different parties were quite disconnected and it wasn't possible to have a common agreement about its implementation. That's why the suggested way is to retrieve objects and transform as desired. As per discussion in the bug comments & also with dev i see that there is nothing that needs to be verified from code side and the verification lies in the documentation PR linked here. Looked at the doc PR and i see that command oc get -o yaml --export all > <yaml_filename> has been replaced with oc get -o yaml all > <yaml_filename>. Also "The object types included in oc get --export all are" has been replaced with "The object types included in oc get -o yaml all are:" in 4.7 & 4.6 documentation. Based on the above moving the bug to verified state. 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 |