-
Notifications
You must be signed in to change notification settings - Fork 557
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
Merged
Merged
+288
−82
Conversation
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
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 <[email protected]>
We will use this to do proper discovery across multiple versions. Signed-off-by: Stephen Finucane <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Avoid unnecessary lookups for when we are encoding the version in our service type. Signed-off-by: Stephen Finucane <[email protected]>
And deprecate the old ones since they are no longer used. Signed-off-by: Stephen Finucane <[email protected]>
9fa3721
to
8139f99
Compare
mandre
approved these changes
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this better than #3350, as this PR effectively implements the missing bits for versioned endpoint discovery, rather than hacking around it.
Let's wait a bit for the periodic jobs to run a few times before we backport this PR to the v2 branch. |
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
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.Version
field 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