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

get config from the v2 api #193

Merged
merged 10 commits into from
Jan 16, 2017
Merged

get config from the v2 api #193

merged 10 commits into from
Jan 16, 2017

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Jan 2, 2017

Configuration environments (staging/production) using new API.

The API looks like:

GET /admin/api/services/:service_id/proxy/configs/:environment/latest.json

That allows us to have new ENV variable THREESCALE_DEPLOYMENT_ENV to control from which environment to load the configuration. Right now it is sandbox (possibly renamed in the future) or production.

It is using HTTP client from APItools project. It supports fake backend/ stubbing in tests which makes it really useful even though it is quite big and would deserve some refactoring. Eventually it should be extracted into own project.


TODO

  • figure out a way how to test APItools http client (http_ng) backend adapters
    • it needs to connect to a socket, so probably test-nginx ?
    • resty can import parts of the nginx configuration, for example to start a server

@mikz mikz force-pushed the lazy-load-configuration branch 6 times, most recently from c0faeec to 38a7c41 Compare January 5, 2017 09:16
@mikz mikz force-pushed the lazy-load-configuration branch from 38a7c41 to 3505031 Compare January 5, 2017 12:59
@mikz mikz closed this Jan 9, 2017
@mikz mikz removed the in progress label Jan 9, 2017
@mikz mikz changed the base branch from v2 to master January 9, 2017 14:30
@mikz mikz reopened this Jan 9, 2017
@mikz mikz force-pushed the lazy-load-configuration branch 5 times, most recently from b55d26e to 8808f88 Compare January 10, 2017 17:38
@mikz mikz changed the title multi tenant configuration [wip] multi tenant configuration Jan 10, 2017
@mikz mikz force-pushed the lazy-load-configuration branch from 8808f88 to 9d7cb72 Compare January 11, 2017 17:47
@mikz mikz changed the title [wip] multi tenant configuration [wip] configuration per environment Jan 12, 2017
@mikz mikz force-pushed the lazy-load-configuration branch from 573b63a to cfe8929 Compare January 12, 2017 10:14
APItools/monitor#10

APItools had quite advanced http client with custom backends
and async requests. I hope to take that as a base to create smart
http client that would understand caching and authentication.

But also having custom backends would make it much easier to test and
stub responses.

[http_ng] cleanup the code to not use globals

[http_ng] pass the luacheck linter
mikz added 2 commits January 13, 2017 16:13
definitely not finished, does not do any path normalization
@mikz mikz force-pushed the lazy-load-configuration branch from c0c408d to bbad8d5 Compare January 13, 2017 15:13
@mikz mikz force-pushed the lazy-load-configuration branch 2 times, most recently from 8fd6ea2 to 8cda4e8 Compare January 13, 2017 15:27
@mikz mikz changed the title [wip] configuration per environment get config from the v2 api Jan 13, 2017
@mikz mikz force-pushed the lazy-load-configuration branch from 8cda4e8 to e2bb5ad Compare January 13, 2017 15:32
@mikz mikz added this to the RHAMP 2.0 ER2 milestone Jan 13, 2017
mikz added 2 commits January 16, 2017 09:46
they are useless for the balancer until we support SRV
when they are added to the configuration
@mikz mikz merged commit 5bf661d into master Jan 16, 2017
@mikz mikz removed the in progress label Jan 16, 2017
@mikz mikz deleted the lazy-load-configuration branch January 16, 2017 08:55
@@ -531,7 +531,33 @@ all ok
--- error_log
host foo for service 2 already defined by service 1

=== TEST 12: return headers with debugging info
=== TEST 12: print message that service was added to the configuration
Including it's host so it is easy to see that configuration was loaded.
Copy link
Contributor

Choose a reason for hiding this comment

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

it's => its ? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:)

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.

2 participants