Bug 1573350 - oc process exits with error if current project does not exist any longer [NEEDINFO]
Summary: oc process exits with error if current project does not exist any longer
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-01 00:48 UTC by Justin Pierce
Modified: 2018-05-01 15:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-01 15:10:21 UTC
Target Upstream Version:
jvallejo: needinfo? (deads)


Attachments (Terms of Use)

Description Justin Pierce 2018-05-01 00:48:43 UTC
Description of problem:
If the current project in scope no longer exists, even when `oc process` has no need for the current project, it will terminate with an error unless -n is specified.

Version-Release number of selected component (if applicable):
v3.9.14

How reproducible:
100%

Steps to Reproduce:
1. oc new-project jmp-gone
2. oc delete project jmp-gone
3. oc adm create-bootstrap-policy-file --filename=/tmp/reconcile_roles.tmp
4. oc process -f /tmp/reconcile_roles.tmp

Actual results:
$ oc process -f /tmp/reconcile_roles.tmp
error: unable to process template
  namespaces "jmp-gone" not found

$ oc process -f /tmp/reconcile_roles.tmp -n jmp | grep jmp
(no output -- meaning no namespace was used)

Expected results:
The template in this example does not need the current namespace -- it should not error.

Comment 1 Jessica Forrester 2018-05-01 13:29:41 UTC
Pretty sure this is not a CLI bug since oc process is using processedtemplate API which is a namespaced API, and therefore requires a project.

Comment 2 Jordan Liggitt 2018-05-01 15:10:21 UTC
correct. processing a template does run against a namespace, which is required to exist. if you want to process locally, use `oc process --local`


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