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

Enable binding of mysql db service to CF hosted console #1260

Merged
merged 11 commits into from
Oct 3, 2017

Conversation

richard-cox
Copy link
Contributor

@richard-cox richard-cox commented Sep 13, 2017

No description provided.

Copy link
Contributor

@nwmac nwmac left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -21,6 +21,7 @@ type VCAPCredential struct {
Username string `json:"username"`
Password string `json:"password"`
Dbname string `json:"dbname"`
name string `json:"name"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we case this "Name", so it is consistent.

db.Password = dbCredentials.Password
db.Database = dbCredentials.name
db.Host = dbCredentials.Hostname
db.Port, err = strconv.Atoi(dbCredentials.Port)
Copy link
Contributor

Choose a reason for hiding this comment

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

You're not using "err, so you should use underscore (_).

1. Create a Service Instance for the Console Database

Use `cf create-service` to create a service instance for the Postges DB - for example:
> **NOTE** The console supports postgresql and mysql DBs. Your service instance must be tagged with either `stratos_postgresql` for postrgresql or `stratos_mysql` for mysql.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in postrgresql

return false
}

for _, services := range vcapServices {
if len(services) == 0 {
continue
}

service := services[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes only one service instance of any given type is bound - which is probably fine, but we could iterate through them all.

@nwmac nwmac merged commit fd92a0e into master Oct 3, 2017
@irfanhabib irfanhabib deleted the cf-db-migrate-mysql-2 branch November 22, 2017 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants