You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider API major version, not API microversion major version
In commit f28c963, we added support for
discovering API versions. To do this, we added a dependency on the
'version' and 'min_version' headers, which are used by services with
microversion support to document the maximum and minimum API versions
supported, respectively. However, not all services support API
microversions: services like Glance and Designate use API versions as a
signal of a new feature (or, in Glance's case, as a signal that a
feature is not enabled), others like Keystone just support a single
version, while Neutron does its own thing with API extensions [1]. Given
this fact, relying on these fields is a mistake.
Instead, we should be relying on the 'id' field. Per the api-sig
guidelines [2], this should be the API major version [3]. We continue
parsing the microversion-related headers, since it will be useful later
on if/when we want to do versioned discovery.
[1] https://that.guru/blog/api-versioning-in-openstack/
[2] https://specs.openstack.org/openstack/api-sig/guidelines/discoverability.html
[3] The studious among you may notice that the api-sig guidelines
indicate that the maximum API microversion should be exposed via the
'max_version' header. However, in practice, virtually everyone uses
'version' instead. Why? Who knows. Best to just take these things on
the chin and move on with our lives.
[4] The term "major version" is a bit loaded. Consider Nova: at the time
of writing, it exposes two "major versions": v2.0 and v2.1. v2.0
does not support microversions. v2.1 does. For v2.1 you therefore
also have microversions to content with and at the time of writing
it supports a minimum microversion of 2.1 and a maximum microversion
of 2.100 (no 'v' prefix here). Normalizing these as we've done here
gives us a major version of 2, a minor version of 1, a major maximum
microversion of 2, a minor maximum microversion of 100, a major
minimum microversion of 2, and a minor minimum microversion of 1 🤯.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
0 commit comments