Bug 1258033 - Allow the override of pre-defined function for database connections
Allow the override of pre-defined function for database connections
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Abhishek Gupta
Gaoyun Pei
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2015-08-28 13:32 EDT by Eric Rich
Modified: 2017-01-04 16:18 EST (History)
7 users (show)

See Also:
Fixed In Version: rubygem-openshift-origin-node-
Doc Type: Enhancement
Doc Text:
Feature: Allow the provided database connection helper functions mysql(), psql(), and mongo() to be overwritten. Reason: This change allows users to overwrite the helper functions to easily connect to external databases. Result: Users can now define mysql(), psql(), and mongo() functions in their $OPENSHIFT_DATA_DIR/.bash_profile, which can be used within an ssh connection to a gear.
Story Points: ---
Clone Of:
Last Closed: 2017-01-04 15:23:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Eric Rich 2015-08-28 13:32:44 EDT
Description of problem:

Customers who want a unified experience with openshift and external databases (who might be using SCL version of databases) need the capability to override database function, in the rhcsh script (because they are not using SCL cartridges that can be auto discovered.)
Comment 1 Eric Rich 2015-08-28 13:34:17 EDT
This relates to https://github.com/openshift/origin-server/pull/6227
Comment 5 Timothy Williams 2016-09-29 11:17:37 EDT
Re-opening this bug since the fix finally merged. The fix originally was meant to be merged but appears to have hit an issue with our automation and took ~8 months to merge:

Comment 9 Gaoyun Pei 2016-12-13 22:26:01 EST
Verify this bug with puddle 2.2/2016-12-12.1 

1. Create an app
2. Log into the gear and modify ~/app-root/data/.bash_profile file with the following contents:

function mongo() {
  echo "mongo replaced!"

function mysql() {
  echo "mysql replaced!"

function psql() {
  echo "psql replaced!"

3. Log into it again and run `mysql`, `mongo`, and `psql`

[app3-yes.ose22-auto.com.cn 5850b7ad82611d5be4000001]\> mysql
mysql replaced!
[app3-yes.ose22-auto.com.cn 5850b7ad82611d5be4000001]\> mongo
mongo replaced!
[app3-yes.ose22-auto.com.cn 5850b7ad82611d5be4000001]\> psql
psql replaced!
Comment 11 errata-xmlrpc 2017-01-04 15:23:09 EST
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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