8000 0.8.0 continuously appends database key to custom config when started · Issue #32 · Kong/docker-kong · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.8.0 continuously appends database key to custom config when started #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jusw85 opened this issue Apr 18, 2016 · 2 comments
Closed
Assignees

Comments

@jusw85
Copy link
jusw85 commented Apr 18, 2016

I've run 0.8.0 with custom config to postgres as follows:

$ docker run -d \
    -v /path/to/your/kong/configuration/directory/:/etc/kong/ \
    -p 8000:8000 \
    -p 8443:8443 \
    -p 8001:8001 \
    -p 7946:7946 \
    -p 7946:7946/udp \
    --security-opt seccomp:unconfined \
    --name kong \
    mashape/kong

kong.yml

....
database: "postgres"
....

However, setup.sh appends the DATABASE variable to config when run.

kong.yml

....
database: "postgres"
....
database: "cassandra"

It doesn't pickup my postgres in kong.yml unless the DATABASE environment variable is set to "postgres" as well (it's set to cassandra by default). Even then, database: "postgres" is appended to my kong.yml every time I restart the container.

@jusw85 jusw85 changed the title 0.8.0 continuously appends database key with custom config when started 0.8.0 continuously appends database key to custom config when started Apr 18, 2016
@subnetmarco
Copy link
Member

I guess the check could be changed so that by default it doesn't append anything, but then it's mandatory to specify the DATABASE environment variable or point to configuration file that already has it.

@jusw85
Copy link
Author
jusw85 commented Apr 18, 2016

I think the check for DATABASE and appending to kong.yml is only necessary when running with the default kong.yml in Kong Docker, to differentiate between PG and Cassandra database.

With an attached custom kong.yml which has already been prepared, no changes are necessary to this file. Maybe there could be an additional environment variable check in setup.sh e.g. $CUSTOM_KONG_CONFIG if appending is necessary.

if [-z "$CUSTOM_KONG_CONFIG" ]; then
    if [ -z "$DATABASE" ]; then
      DATABASE="cassandra"
    fi
    echo -e '\ndatabase: "'$DATABASE'"' >> /etc/kong/kong.yml
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0