[openstack-dev] Versions api always returns the listen address

Sean Dague sean at dague.net
Tue Feb 23 11:58:36 UTC 2016


On 02/23/2016 06:49 AM, Gyorgy Szombathelyi wrote:
> Hi!
> 
> Just noticed by a failing tempest.api.compute.test_versions.TestVersions.test_get_version_details test:
> The versions answer of the components always return the listen address of the corresponding daemon. 
> Is this the intended behavior? I think it should tell the public endpoint, the listening address in a HA cluster
> cannot nor should be reached from the outside.
> 
> E.g. we have a  setup, where every service have an apache proxy in front of it, so getting the versions returns:
> 
> # curl http://192.168.168.100:8774 
> 
> {"versions": [{"status": "SUPPORTED", "updated": "2011-01-21T11:33:21Z", "links": [{"href": "http://127.0.0.1:8774/v2/", "rel": "self"}], "min_version": "", "version": "", "id": "v2.0"}, {"status": "CURRENT", "updated": "2013-07-23T11:33:21Z", "links": [{"href": "http://127.0.0.1:8774/v2.1/", "rel": "self"}], "min_version": "2.1", "version": "2.12", "id": "v2.1"}]}
> 
> Notice the href: "http://127.0.0.1:8774/xxx" answer.
> 
> Or the reason is to not return the public endpoint that it would require a keystone session, and the versions API must be lightweight?

If you put a proxy in front of things you need to also set
osapi_compute_link_prefix -
https://github.com/openstack/nova/blob/d8ddecf6e3ed1e8193e5f6dba910eb29bbe6dac6/nova/api/openstack/common.py#L45-L47

This Tempest test was specifically added about six months ago when we
realized that people didn't realize that, and were returning invalid
links in their environment. It's meant to be a sanity check for people's
clouds as much as an interop test.

	-Sean

-- 
Sean Dague
http://dague.net



More information about the OpenStack-dev mailing list