Add versioned endpoint discovery#3351
Merged
mandre merged 8 commits intogophercloud:mainfrom Jun 10, 2025
Merged
Conversation
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>
9fa3721 to
8139f99
Compare
Contributor
|
Let's wait a bit for the periodic jobs to run a few times before we backport this PR to the v2 branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Versionfield which is compared against both the implicit version encoded in some service type aliases (likevolumev3) 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