Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add versioned endpoint discovery #3351

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
Loading
from

Conversation

stephenfin
Copy link
Contributor

This is an alternative or successor to #3350. We expand upon our endpoint negotiation to add support for version discovery.

There's a lot of context in the commits but in effect, we add a new EndpointsOpts.Version field which is compared against both the implicit version encoded in some service type aliases (like volumev3) and the explicit version presented by service's version document, which we now fetch.

We may wish to build on this in the future to allow filtering of endpoints by a minimum microversion (allowing for early failure) or to add support for keystoneauth's URL-derived "version hack" (though I'm hoping the world has moved on enough not to make that necessary).

While the logic here is quite similar to what is done in keystoneauth, this PR should be thoroughly tested against a few different clouds before we merge it, due to the many nuances involved here.

Fixes #3349

@github-actions github-actions bot added edit:openstack This PR updates common OpenStack code edit:utils This PR updates utils code edit:baremetal This PR updates baremetal code edit:gophercloud This PR updates common Gophercloud code semver:minor Backwards-compatible change labels Apr 17, 2025
@coveralls
Copy link

coveralls commented Apr 17, 2025

Coverage Status

coverage: 63.706% (-0.1%) from 63.828%
when pulling 8139f99 on stephenfin:endpoint-discovery
into 0d4b2d4 on gophercloud:main.

We do not need to check the validity of the provided opts more than once
so don't. We can also simplify our handling of multiple endpoints
(though not as much as we'd like in the v2 case, due to forthcoming
patches).

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We will use this to do proper discovery across multiple versions.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This retrieves the base endpoint without stripping the version information.
This is helpful for service catalog entries that include project IDs, like
those historically preferred by Cinder for some reason.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is an re-implementation of GetSupportedMicroversions that supports
use with a ProviderClient and an explicit endpoint URL, allowing us to
use this during discovery.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
For now these are exact duplicates of the V2EndpointURL and V3EndpointURL
helpers but with different names.

  diff -u openstack/endpoint_location.go openstack/endpoint.go

This is done to ease review. We will introduce further differences shortly.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is simpler than expected. Effectively, for each potential endpoint,
we retrieve the version document from the root URL and parse the version
information, if any, from it, comparing it against the version expected.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Avoid unnecessary lookups for when we are encoding the version in our
service type.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
And deprecate the old ones since they are no longer used.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
@stephenfin stephenfin force-pushed the endpoint-discovery branch from 9fa3721 to 8139f99 Compare May 16, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edit:baremetal This PR updates baremetal code edit:gophercloud This PR updates common Gophercloud code edit:openstack This PR updates common OpenStack code edit:utils This PR updates utils code semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gophercloud does not support versioned discovery
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.