Bug 1305826 - [DOCS] Update Database Images Docs to reflect correct usage of environment variables
Summary: [DOCS] Update Database Images Docs to reflect correct usage of environment va...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Deadline: 2016-03-15
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ashley Hardin
QA Contact: Xingxing Xia
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-09 10:40 UTC by Vikram Goyal
Modified: 2016-02-23 14:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-23 14:33:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vikram Goyal 2016-02-09 10:40:42 UTC
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 15:59:58 UTC
@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-18 03:46:37 UTC
`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 06:12:05 UTC
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 21:48:27 UTC
Edits complete. Added ifdef statements so that both OSE and Origin users get the right syntax.

Comment 5 Xingxing Xia 2016-02-19 02:00:37 UTC
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-19 02:56:06 UTC
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 14:14:19 UTC
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 14:16:46 UTC
Extra space removed and the content is merged.

Comment 9 Xingxing Xia 2016-02-22 02:01:47 UTC
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.