Bug 1305826 - [DOCS] Update Database Images Docs to reflect correct usage of environment variables
[DOCS] Update Database Images Docs to reflect correct usage of environment va...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation (Show other bugs)
3.1.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ashley Hardin
Xingxing Xia
Vikram Goyal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-09 05:40 EST by Vikram Goyal
Modified: 2016-02-23 09:33 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-23 09:33:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vikram Goyal 2016-02-09 05:40:42 EST
Docs Location:
https://docs.openshift.com/enterprise/3.1/using_images/db_images/index.html

There are three database images defined here: MySQL, PostGresSQL and MongoDB.

I tried to follow the instructions for installing the MySQL image, and when I got to this part, https://docs.openshift.com/enterprise/3.1/using_images/db_images/mysql.html#initializing-the-database, using this command caused an error:

$ oc new-app -e MYSQL_USER=<username>,MYSQL_PASSWORD=<password>,MYSQL_DATABASE=<database_name> openshift/mysql-55-centos7

error: environment variables must be of the form key=value: 

The correct command should be of the format:

$ oc new-app -e MYSQL_USER=<username>:MYSQL_PASSWORD=<password>:MYSQL_DATABASE=<database_name> openshift3/mysql-55-rhel7

Note the change in the way the environment variables are provided (key=value:) AND the name of the image.

This needs to change for all three database configurations: MySQL, PostgresSQL and MongoDB.
Comment 1 Ashley Hardin 2016-02-17 10:59:58 EST
@Vikram,
Please review and let me know if this satisfies the request:
https://github.com/openshift/openshift-docs/pull/1604
Comment 2 Xingxing Xia 2016-02-17 22:46:37 EST
`oc new-app`, environment variables after "-e" should use "," rather than ":" as delimiter.
See following tests against both of latest Origin and OSE environments (Origin versions: openshift/oc v1.1.3-32-g5ab601a
kubernetes v1.2.0-alpha.7-703-gbc4550d; OSE versions: openshift/oc v3.1.1.903
kubernetes v1.2.0-origin):
1. Use ","
$ oc new-app -e ENV1=V1,ENV2=V2 openshift/hello-openshift --name=app1
$ oc env pod/app1-1-d81ia --list
# pods app1-1-d81ia, container app1
ENV1=V1
ENV2=V2

2. Use ":"
$ oc new-app -e ENV1=V1:ENV2=V2 openshift/hello-openshift --name=app2
$ oc env pod/app2-1-0h9m1 --list
# pods app2-1-0h9m1, container app2
ENV1=V1:ENV2=V2
Comment 3 Wenjing Zheng 2016-02-18 01:12:05 EST
All rhel7 images are released to this registry: registry.access.redhat.com, so cannot use openshift3/mysql-55-rhel7 to get the image; 
one more thing is mongodb-26-rhel7 is under rhscl namespace like this registry.access.redhat.com/rhscl/mongodb-26-rhel7; same for postgresql-94-rhel7 image should be registry.access.redhat.com/rhscl/postgresql-94-rhel7.
Comment 4 Ashley Hardin 2016-02-18 16:48:27 EST
Edits complete. Added ifdef statements so that both OSE and Origin users get the right syntax.
Comment 5 Xingxing Xia 2016-02-18 21:00:37 EST
As of right now, the Doc PR looks good for me, except the note "there's an extra space ..." in the PR.
Will move this bug to VERIFIED when the PR is merged.
Comment 6 Vikram Goyal 2016-02-18 21:56:06 EST
Thanks Ashley and Xingxing. I am not sure why when I ran this on my install it told me that the correct form is:

error: environment variables must be of the form key=value:.

I have since verified it and it is not giving me that error any more. So the original intent of the bug is no longer there. But it is a good thing that we are fixing the other issue identified by Wenjing.
Comment 7 openshift-github-bot 2016-02-19 09:14:19 EST
Commits pushed to master at https://github.com/openshift/openshift-docs

https://github.com/openshift/openshift-docs/commit/b1fbf6be4c38d325f205408119f6a250ddbb0071
Bug 1305826, edited commands: creating new databases for MySQL, PostgresSQL,mongodb

https://github.com/openshift/openshift-docs/commit/946f50fef9c2ca460f50e5b53b93c91aa06c6407
Merge pull request #1604 from ahardin-rh/enviro-variables

Bug 1305826, edited commands for creating new databases for MySQL, PostgresSQL, MongoDB
Comment 8 Ashley Hardin 2016-02-19 09:16:46 EST
Extra space removed and the content is merged.
Comment 9 Xingxing Xia 2016-02-21 21:01:47 EST
The PR is merged, so move to VERIFIED.

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