Context
Consumers that use clouds.yaml may want per-cloud service microversion defaults using the openstacksdk convention:
clouds:
cloud_a:
auth: ...
compute_default_microversion: "2.87"
cloud_b:
auth: ...
compute_default_microversion: "2.79"
This is useful for long-running multi-cloud processes where environment variables such as OS_COMPUTE_API_VERSION are too coarse because they apply process-wide rather than per selected cloud.
One downstream example is openstack-exporter, which can scrape multiple clouds from one clouds.yaml and currently has to manage Nova microversions outside of clouds.yaml: openstack-exporter/openstack-exporter#500
Current behavior
clientconfig.Cloud exposes typed API-version override fields such as identity_api_version and volume_api_version, but does not expose compute_default_microversion or a generic {service_type}_default_microversion mechanism. LoadCloudsYAML() unmarshals into map[string]Cloud, so callers cannot recover these keys through the public Cloud type after parsing.
Proposal
Add support for openstacksdk-style service default microversions in clientconfig, preferably in a way that can support more than Nova over time.
Possible API shapes:
- a generic map on
Cloud, e.g. DefaultMicroversions map[string]string, populated from keys matching {service_type}_default_microversion;
- typed fields for known OpenStack services, starting with
ComputeDefaultMicroversion;
- helper methods such as
cloud.DefaultMicroversion("compute") so downstream consumers do not need to duplicate key normalization rules.
Open questions:
- Should this live only in
github.com/gophercloud/utils/v2/openstack/clientconfig, or should github.com/gophercloud/gophercloud/v2/openstack/config/clouds grow equivalent support too?
- Should service names follow catalog service types exactly, such as
compute, block-storage, and shared-file-system, or openstacksdk config aliases?
- Should env var precedence remain the caller's responsibility, or should
clientconfig.NewServiceClient apply a parsed default microversion automatically where possible?
Context
Consumers that use
clouds.yamlmay want per-cloud service microversion defaults using the openstacksdk convention:This is useful for long-running multi-cloud processes where environment variables such as
OS_COMPUTE_API_VERSIONare too coarse because they apply process-wide rather than per selected cloud.One downstream example is
openstack-exporter, which can scrape multiple clouds from oneclouds.yamland currently has to manage Nova microversions outside ofclouds.yaml: openstack-exporter/openstack-exporter#500Current behavior
clientconfig.Cloudexposes typed API-version override fields such asidentity_api_versionandvolume_api_version, but does not exposecompute_default_microversionor a generic{service_type}_default_microversionmechanism.LoadCloudsYAML()unmarshals intomap[string]Cloud, so callers cannot recover these keys through the publicCloudtype after parsing.Proposal
Add support for openstacksdk-style service default microversions in
clientconfig, preferably in a way that can support more than Nova over time.Possible API shapes:
Cloud, e.g.DefaultMicroversions map[string]string, populated from keys matching{service_type}_default_microversion;ComputeDefaultMicroversion;cloud.DefaultMicroversion("compute")so downstream consumers do not need to duplicate key normalization rules.Open questions:
github.com/gophercloud/utils/v2/openstack/clientconfig, or shouldgithub.com/gophercloud/gophercloud/v2/openstack/config/cloudsgrow equivalent support too?compute,block-storage, andshared-file-system, or openstacksdk config aliases?clientconfig.NewServiceClientapply a parsed default microversion automatically where possible?