Bug 1006067 - [RFE] Add better tooling in rhc to switch between accounts
Summary: [RFE] Add better tooling in rhc to switch between accounts
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 1.x
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1006068
TreeView+ depends on / blocked
 
Reported: 2013-09-09 23:13 UTC by Timothy Williams
Modified: 2013-09-25 20:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1006068 (view as bug list)
Environment:
Last Closed: 2013-09-25 20:41:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Timothy Williams 2013-09-09 23:13:29 UTC
We have several different OSE deployments now as we've separated pre-production from production, etc.  At first, folks were hand-editing rhc's ~/.openshift/express.conf all the time.  Now, folks are doing this as a workaround:

1. Copy your existing .openshift/express.conf to new files, one per environment:
cp ~/.openshift/express.conf ~/.openshift/express.conf.dev
cp ~/.openshift/express.conf ~/.openshift/express.conf.uat


2. Add these aliases to your ~/.bash_profile:
alias rhcd="rhc --config=~/.openshift/express.conf.dev"
alias rhcu="rhc --config=~/.openshift/express.conf.uat"

3.  Use your new commands (after logging out and back in, so your bash_profile takes effect):
# SSH to the UAT security service:
rhcu ssh security

That's a fine workaround, but I'd like to see "rhc account" get extended with something like "--list" and "--set", where "--list" gave you a one-line list of alternate OpenShift account aliases (such as "dev" and "uat", or "default" for initial default settings).  "--set" would let you pick a different alias.  "rhc setup" should let you pick an alias for those different configs going forward.

So the interaction would be something like::

# rhc account --list
default
dev
uat *
prod

# rhc account --set prod
# rhc account --list
default
dev
uat
prod *

Comment 1 Xiaoli Tian 2013-09-10 03:27:13 UTC
You could work around this by setting OPENSHIFT_CONFIG env variable as well:


For eg:
Make different config file for different account under ~/.openshift/
express.conf
dev.conf
uat.conf
prod.conf

export OPENSHIFT_CONFIG=dev&rhc setup will run  with the server and account set in dev.conf 

#export OPENSHIFT_CONFIG= 
will reset to use default config file.

Comment 2 Clayton Coleman 2013-09-25 20:41:04 UTC
Our only supported option now is the OPENSHIFT_CONFIG var as Xiaoli notes.  I would recommend aliasing that to the account in your shell.


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