Red Hat Bugzilla – Bug 1305826
[DOCS] Update Database Images Docs to reflect correct usage of environment variables
Last modified: 2016-02-23 09:33:49 EST
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.
Please review and let me know if this satisfies the request:
`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 v18.104.22.1683
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
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
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.
Edits complete. Added ifdef statements so that both OSE and Origin users get the right syntax.
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.
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.
Commits pushed to master at https://github.com/openshift/openshift-docs
Bug 1305826, edited commands: creating new databases for MySQL, PostgresSQL,mongodb
Merge pull request #1604 from ahardin-rh/enviro-variables
Bug 1305826, edited commands for creating new databases for MySQL, PostgresSQL, MongoDB
Extra space removed and the content is merged.
The PR is merged, so move to VERIFIED.
Content is now published: