-
Notifications
You must be signed in to change notification settings - Fork 13
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
Read bindings from VCAP_SERVICES #228
Read bindings from VCAP_SERVICES #228
Conversation
It looks like the linter is flagging at least one thing here. If you run |
0457fa8
to
d62070b
Compare
My bad. Should be fixed now. |
Sorry, it's still failing. The DCO check is failing as well. That's a pain, but if you click Details it walks you through how to fix that. |
My bad again. I always forget that one. But also the unit tests are failing, though they worked locally. I'll have a look. |
Maybe it's a race condition? The failing test is reading an env variable, so perhaps two tests are running try to read the same env variable and it's an inconsistent result. I can't say this is the issue and I don't have a specific reason, other than that's the way I've always seen it done, but when I set env variables in unit tests I always do them in a
In your PR, you're setting the env variables directly in each test. |
Signed-off-by: Ralf Pannemans <ralf.pannemans@sap.com>
d62070b
to
dc9c7f2
Compare
The problem was that the tests rely on the order of the bindings, gut the order when iterating through a dict is not guaranteed in go. It works most of the time, but not always. The same problem should be in |
Awesome catch & fix! Thanks for the other PR as well. |
@c0d1ngm0nk3y - I was thinking about this more, and I think we should adjust the way this maps a little bit. First, the service binding spec has two entries that you can populate, one is required the I think we should also try to flatten out the Like this:
|
Like this? #235 |
Buildpacks like https://github.com/paketo-buildpacks/dynatrace need specific bindings (e.g. credentials to download assets). If the bindings are not only read from the file system, but from the env variable
VCAP_SERVICES
, those buildpacks could be used not only on kubernetes, but also on cloudfoundry.Backport of #227