-
Notifications
You must be signed in to change notification settings - Fork 553
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
stephenfin
wants to merge
8
commits into
gophercloud:main
Choose a base branch
from
stephenfin:endpoint-discovery
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 <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
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