Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't export resources and use them in different namespaces using get --export. #24372

Closed
ammarzia opened this issue Jan 7, 2020 · 2 comments

Comments

@ammarzia
Copy link

ammarzia commented Jan 7, 2020

If I backup a resource in a namespace using $ oc get --export and then apply it to a different namespace, I get the following error:

error: the namespace from the provided object "dev" does not match the namespace "prod". You must pass '--namespace=dev' to perform this operation.

$ oc get --export exported the dev namespace which means I can only apply it in that namespace. I can't apply it elsewhere. This happens because $ oc get --export exports additional metadata about kubernetes resources that the deprecated $ oc export doesn't export.

It looks like this behavior is intentional:
kubernetes/kubernetes#73787 (comment)
kubernetes/kubernetes#57898
#10091 (comment)

I can remove namespaces from the resource using jq or yq, but is there a better solution specifically for OpenShift that doesn't involve editing the resource?

Version

v3.11.146

@ammarzia ammarzia changed the title Can't export resources and use them in different namespaces using --get export. Can't export resources and use them in different namespaces using oc get --export. Jan 7, 2020
@ammarzia ammarzia changed the title Can't export resources and use them in different namespaces using oc get --export. Can't export resources and use them in different namespaces using get --export. Jan 7, 2020
@soltysh
Copy link
Contributor

soltysh commented Feb 13, 2020

This functionality is removed by now. I'm going to close this.
/close

@openshift-ci-robot
Copy link

@soltysh: Closing this issue.

In response to this:

This functionality is removed by now. I'm going to close this.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants