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

DeploymentConfig export always contains reference to old Namespace #10091

Closed
damemi opened this issue Jul 28, 2016 · 17 comments
Closed

DeploymentConfig export always contains reference to old Namespace #10091

damemi opened this issue Jul 28, 2016 · 17 comments
Assignees
Labels
component/composition lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P3

Comments

@damemi
Copy link

damemi commented Jul 28, 2016

When exporting a DeploymentConfig to either JSON or YAML, there is a field entry added to the exported template under Spec.Triggers.ImageChangeParams.From with the Namespace the DC is currently in. Is this an intentional feature? There doesn't seem to be any documentation on it. It's possible that, when exporting a DC, a user may not want any references to the Namespace from which it was exported (such as in the case of re-creating that DC in a different Namespace).

Steps To Reproduce
  1. Create a project with a deploymentconfig
  2. oc export -o yaml dc
    (note: this also occurs with other oc commands such as oc get as well as JSON)
Current Result
- apiVersion: v1
  kind: DeploymentConfig
  ...
  spec:
    ...
    triggers:
    - imageChangeParams:
        ...
        from:
          kind: ImageStreamTag
          name: origin-ruby-sample:latest
          namespace: test
Expected Result

It would be nice to be able to exclude the namespace field when exporting these kind of resources.

@abhgupta
Copy link
Member

The concrete use case that we are looking at is moving ALL resources within the project to a different project/namespace.

@bparees
Copy link
Contributor

bparees commented Jul 28, 2016

@mfojtik is oc export your team?

@mfojtik
Copy link
Contributor

mfojtik commented Aug 1, 2016

@bparees I think so (@pweil- ?).

@abhgupta @damemi what if the ICT.From namespace is there intentionally and you really looking for a change in the image stream tag defined in namespace other than the current namespace. For example you have a "canary" namespace, where you deploy when the image is changed and you promote the image to another namespace? Would that be a valid case?

If yes, then the solution here might be to opt-out the namespace when the namespace matches the namespace from where the DC is being exported. @deads2k @liggitt agree?

@mfojtik
Copy link
Contributor

mfojtik commented Aug 1, 2016

@bparees I think it is @ncdc team now ;-)

@deads2k
Copy link
Contributor

deads2k commented Aug 1, 2016

If yes, then the solution here might be to opt-out the namespace when the namespace matches the namespace from where the DC is being exported. @deads2k @liggitt agree?

For most of our API, namespace="" in an object ref means "use the current namespace". There's some argument that pinning it, namespace=<current-namespace>, means "use this exactly namespace, not the current one". Exporting is one of those cases were sometimes you definitely want X and other times you definitely want notX.

Oh, and our server-side export logic only gets an "on/off" flag on requests, no details.

@bparees
Copy link
Contributor

bparees commented Aug 1, 2016

Exporting is one of those cases were sometimes you definitely want X and other times you definitely want notX.

and if you specify -o template you probably want "Y" where "Y" is "make the namespace field a parameter with a default value of either X or notX"

@bparees
Copy link
Contributor

bparees commented Aug 1, 2016

s/-o template/--as-template/

@ncdc
Copy link
Contributor

ncdc commented Aug 1, 2016

@mfojtik oc export is an origin thing, so it's not me (although we'd be happy to discuss the issue)

@deads2k
Copy link
Contributor

deads2k commented Aug 1, 2016

@mfojtik oc export is an origin thing, so it's not me (although we'd be happy to discuss the issue)

@ncdc note the "export" support on GETs from the kube API server.

@ncdc
Copy link
Contributor

ncdc commented Aug 1, 2016

@deads2k sure, but we aren't using that in origin now. Also, this is about handling a field specific to an origin resource, which sounds like an origin problem (unless we implement something like https://trello.com/c/pqGl8CVe/276-5-api-types-should-be-able-to-express-do-not-export).

@deads2k
Copy link
Contributor

deads2k commented Aug 1, 2016

@deads2k sure, but we aren't using that in origin now. Also, this is about handling a field specific to an origin resource, which sounds like an origin problem (unless we implement something like https://trello.com/c/pqGl8CVe/276-5-api-types-should-be-able-to-express-do-not-export).

We tried here: #8570, but we opened kubernetes/kubernetes#24855 to try to achieve some parity upstream first.

@mfojtik mfojtik assigned 0xmichalis and unassigned mfojtik Aug 22, 2016
@0xmichalis
Copy link
Contributor

We didn't use to pin the object reference namespace but ever since we started indexing configs based on those references we need them to be fully expanded. Agreed that oc export / oc get --export should strip them down.

@liggitt
Copy link
Contributor

liggitt commented Aug 22, 2016

Agreed that oc export / oc get --export should strip them down.

I can see both use cases. If you're exporting the whole project and moving all resources to a new one, you want the refs localized (namespace removed). If you're just exporting a dc and expecting it to work in a new namespace, you want the ref to stay absolute

@0xmichalis
Copy link
Contributor

Both are valid. I think that oc get --export should run the default (if it can be considered as default) strip everything down case and oc export should handle all the cases with additional flags. Thoughts?

@0xmichalis 0xmichalis added this to the 1.5.0 milestone Oct 27, 2016
@0xmichalis 0xmichalis removed this from the 1.5.0 milestone Feb 23, 2017
@0xmichalis 0xmichalis assigned tnozicka and unassigned 0xmichalis Apr 19, 2017
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 10, 2018
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 14, 2018
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/composition lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P3
Projects
None yet
Development

No branches or pull requests