-
Notifications
You must be signed in to change notification settings - Fork 55
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
Parity with python client for version variables? #178
Comments
clouds.yaml
I believe that Utils currently supports setting versions through clouds.yaml, and not microversions. The difference for us is that versions determine a different behaviour client-side, while microversions are just passed up to OpenStack (example: older microversions of Nova accept server groups "policies", newer just "policy". Gophercloud delegates the issue to the consumer and expects them to set the microversion accordingly). As a consequence we may just parse the microversion variable, if any, and insert it into the Is that what you had in mind? |
I'm a bit confused about the distinction still, but the goal is to be able to set the OS_*_API_VERSION variables (either in clouds.yaml or environment) and have them respected. From what I can tell they would need to be listed in here. |
Ok after some more digging I have a better understanding of this now. However, I see now that in the docs for microversions it is expected that the client sets these versions. So essentially it would be the job of CAPO to detect and set them. I do see the logic in letting the client provide some "defaults" or overrides (e.g. CAPO has a minimum required nova microversion). However, I think it would make sense to also automatically detect and use any microversions set through environment variables, clouds.yaml or flags, and doing that in gophercloud makes more sense than each client doing it separately. So essentially what I would like to do is change utils/openstack/clientconfig/requests.go Lines 880 to 881 in e8fba78
into something like case "compute":
client, err := openstack.NewComputeV2(pClient, eo)
client.Microversion = detectComputeMicroversion(cloud)
return client, err (But obviously with a nicer implementation.) Does it make sense? |
I think that what you propose makes complete sense, especially here in |
Consistently with what we do when adding API calls, please include pointers to the Python SDK code to justify any microversion parsing in |
Thanks @pierreprinetti ! I have updated the description with some links that I think show that the python SDK is parsing the |
I have a use case for setting the compute API version in
clouds.yaml
and/or thought the env variableCOMPUTE_API_VERSION
, but only identity and volume API versions are currently available. It is however, available in python.After some more research on this, there seems to be more missing in gophercloud than just the compute API version. Would it be acceptable to bring it into parity with the python client? These are the variables that can be used with the python client but are ignored by gophercloud from what I can tell:
Would it be possible to add the compute API version here as well? I would be happy to work on a PR!
Edit: Edited to expand from just comput API version to bring the clientconfig up to parity with the python client.
I'm not well versed in the OpenStack SDK, but I have managed to dig up some hopefully relevant code.
Link to OpenStackSDK files:
The text was updated successfully, but these errors were encountered: