Skip to content

Apply clouds.yaml service default microversions in clientconfig - #288

Open
Sharpz7 wants to merge 5 commits into
gophercloud:mainfrom
Sharpz7:agent/clouds-yaml-default-microversion
Open

Sharpz7 wants to merge 5 commits into
gophercloud:mainfrom
Sharpz7:agent/clouds-yaml-default-microversion

Conversation

@Sharpz7

@Sharpz7 Sharpz7 commented Jul 27, 2026 •

Copy link
Copy Markdown

This adds support for service default microversions in clouds.yaml, so settings like compute_default_microversion: "2.87" are applied by clientconfig.NewServiceClient().

Defaults are preserved in Cloud.DefaultMicroversions. ClientOpts.Microversion overrides the configured value, and callers can still change client.Microversion afterwards. This works with the existing Gophercloud v2.15.0 dependency, so it can merge independently of the core PR.

Canonical service names take precedence over aliases, following openstacksdk's order. Profile, secure-file and selected-region defaults survive merging. null falls through to aliases; an empty string clears an inherited default. A null regional value keeps the cloud default. Versions should be quoted: Python reads unquoted 2.10 as 2.1, while Go preserves 2.10. Automatic negotiation is outside this change.

Tests check authentication and request headers for eight services, overrides, serialization and merging, plus 26 cases generated with openstacksdk 4.20.0 and os-service-types 1.9.0. The SDK fixtures can be regenerated; Go tests do not need Python.

Related: gophercloud/gophercloud#3882
Companion: gophercloud/gophercloud#3881

Tested with:

  • go test ./...
  • go test -race ./openstack/clientconfig/...
  • golangci-lint run ./...

@Sharpz7 Sharpz7 changed the title Support compute default microversion in clouds.yaml Apply clouds.yaml service default microversions in clientconfig Sep 30, 2026
@@ -0,0 +1,57 @@
"""Generate configuration expectations with openstacksdk (optional test tooling).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this kind of thing is acceptable... do let me know. We probably do not want python code here?

Plus we also need it in https://github.com/gophercloud/gophercloud/pull/3881/changes#diff-85e9964491e24b0252b1ced9264c3c642305591347c88b26b6444fb43250bb03

Maybe just one place is enough?

@Sharpz7
Sharpz7 marked this pull request as ready for review September 30, 2026 23:39
@Sharpz7
Sharpz7 requested a review from stephenfin September 30, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant