Skip to content
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

Add support for binding style env vars #199

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Add support for binding style env vars #199

merged 1 commit into from
Sep 19, 2018

Conversation

sspeiche
Copy link

No description provided.

@sspeiche
Copy link
Author

/fyi @spadgett

@sspeiche
Copy link
Author

sspeiche commented Sep 3, 2018

@bparees thoughts on shifting to this approach to accommodate binding

@bparees
Copy link

bparees commented Sep 4, 2018

as long as it matches what the mongo db template exposes as binding params (which it appears to), it lgtm.

someone still has to take the secret created by the binding and turn it into env vars for this pod, for things to work, right?

} else if (process.env.database_name) {
mongoDatabase = process.env.database_name;
mongoPassword = process.env.password;
mongoUser = process.env.username;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these be database_password and database_name ? (i assume the name can be anything we want since it depends on what the user defines the env in the pod as, based on the secret)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these are the exact name that the template service broker is sending back. It has to be env.database_name and env.password (unless there is some manual mapping involved).

This allows for me to just bind and turn into env vars without getting involved (mapping anything).

mongoDatabase = process.env.database_name;
mongoPassword = process.env.password;
mongoUser = process.env.username;
var mongoUriParts = process.env.uri && process.env.uri.split("//");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and database_uri

or mongo_uri

@bparees
Copy link

bparees commented Sep 4, 2018

discussed the naming offline, i understand why it should stay as it is.

lgtm.

@hhorak ptal

@hhorak
Copy link
Member

hhorak commented Sep 19, 2018

Changes tested manually, merging.

@hhorak hhorak merged commit f9a9727 into sclorg:master Sep 19, 2018
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

Successfully merging this pull request may close these issues.

3 participants