-
Notifications
You must be signed in to change notification settings - Fork 135
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
Conversation
There was a problem hiding this 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"` |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
No description provided.