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

Fix failing VCAP_SERVICE credentials check #4084

Merged
merged 3 commits into from
Jan 9, 2020
Merged

Fix failing VCAP_SERVICE credentials check #4084

merged 3 commits into from
Jan 9, 2020

Conversation

richard-cox
Copy link
Contributor

@richard-cox richard-cox commented Jan 8, 2020

  • Fixes Stratos does not default to URI properly #4081
  • When Stratos is deployed via CF and bound to a db service we search VCAP_SERVICE for db credentials
  • If we don't find the right properties we fall back on the uri and try to extract them from there
  • The check for the right properties was failing due to the following concept
fmt.Sprintf("%v", nil) == "<nil>"
  • Fix is to ensure we pass in better values
    Also
  • Tidied up and improved logging
  • Improved handling of uri reg ex

- Fixes 4081
- When Stratos is deployed via CF and bound to a db service we search VCAP_SERVICE for db credentials
- If we don't find the right properties we fall back on the uri and try to extract them from there
- The check for the right properties was failing due to the following concept
```
fmt.Sprintf("%v", nil) == "<nil>"
```
- Fix is to ensure we pass in better values
Also
- Tidied up and improved logging
- Improved handling of uri reg ex
@siennathesane
Copy link

@richard-cox it looks like the new test assertions are failing: https://travis-ci.org/cloudfoundry/stratos/jobs/634288669#L1330

Copy link

@siennathesane siennathesane left a comment

Choose a reason for hiding this comment

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

Assuming the E2E tests pass, it looks good to me and should fix the bug!

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.

One comment to consider

src/jetstream/datastore/database_cf_config.go Outdated Show resolved Hide resolved
@nwmac nwmac added the needs attention This PR needs attention label Jan 8, 2020
@richard-cox richard-cox added comments-addressed and removed needs attention This PR needs attention labels Jan 9, 2020
@nwmac nwmac merged commit 26a3afa into master Jan 9, 2020
@nwmac nwmac deleted the fix-db-env-vars branch January 9, 2020 13:04
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.

Stratos does not default to URI properly
3 participants