Skip to content

Add Some Helpful Fields#2691

Closed
spjmurray wants to merge 1 commit intogophercloud:masterfrom
spjmurray:couple_new_fields
Closed

Add Some Helpful Fields#2691
spjmurray wants to merge 1 commit intogophercloud:masterfrom
spjmurray:couple_new_fields

Conversation

@spjmurray
Copy link
Copy Markdown
Contributor

@spjmurray spjmurray commented Jul 13, 2023

Add the "extra_specs" field in compute flavors, that can avoid another lookup. As documented it's for microversions 2.61 and greater. Documented here:

Prior to starting a PR, please make sure you have read our
contributor tutorial.

Prior to a PR being reviewed, there needs to be a Github issue that the PR
addresses. Replace the brackets and text below with that issue number.

Fixes #2497

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

See commit message... seems I jumped the gun 😸

Copy link
Copy Markdown
Contributor

@kayrus kayrus left a comment

Choose a reason for hiding this comment

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

Looks like everything is already implemented. You just need to use some extra code to obtain the desired information.

// used to avoid extra calls to Get/ListExtraSpecs. This is only available
// in microversion 2.61 and greater, and only if allowed by the compute
// service's policy.
ExtraSpecs map[string]string `json:"extra_specs"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is already implemented, but you can avoid the N extra round trips and just get the data directly in the /details call. So above and beyond the obvious performance improvement, and load reduction, it cleans up client code a lot, especially if you have to mess about with go routines to hide the extra calls.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To prove my point of how bad it can be here's the naive version:
extra_specs_naive

And when you add in a heap of code to parallelize everything:
extra_specs_parallel

Or, what this proposes, is neither of those things and just getting it in the original call.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fair point :)

@spjmurray spjmurray force-pushed the couple_new_fields branch from fcf7b7f to 448ef7e Compare July 13, 2023 08:43
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 79.085%. remained the same when pulling 2d87d05 on spjmurray:couple_new_fields into af3c43d on gophercloud:master.

@spjmurray
Copy link
Copy Markdown
Contributor Author

@kayrus I do note this is a dupe of #2561, my bad for not looking hard enough, sorry. But it has been sat about since February, so I'm unsure if you want to favor one over the other. Your call.

@kayrus
Copy link
Copy Markdown
Contributor

kayrus commented Jul 13, 2023

@spjmurray I also missed this PR, but I'm not a maintainer. @mandre @pierreprinetti have all the cards

@spjmurray
Copy link
Copy Markdown
Contributor Author

spjmurray commented Jul 13, 2023

No wonder they always win at poker!

@pierreprinetti
Copy link
Copy Markdown
Member

@mandre has reviewed #2561 and I'll let him merge one of the two PRs next week when he's more likely to have time for Gophercloud. Thank you for your ping on this issue, and sorry that it's taking longer than necessary; we're really a bit busy with other projects these days.

@spjmurray
Copy link
Copy Markdown
Contributor Author

Thanks for your eyes, I'm not surprised with the time, I've got my fingers in CAPO, openstack-cloud-controller-manager, argocd, and my own platform to boot. Hard to juggle everything at once!

@kayrus
Copy link
Copy Markdown
Contributor

kayrus commented Jul 13, 2023

@pierreprinetti can I volunteer to join the gophercloud maintainers list?

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Jul 19, 2023

The only reason #2561 has not yet merged is that it's a breaking change, and we needed a new branch for merging such changes. From the output of gorelease:

## incompatible changes
Flavor: old is comparable, new is not

We might be able to start merging breaking changes now that we've branched out v1.

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Jul 19, 2023

I'm closing this PR as it's indeed duplicating #2561.

@mandre mandre closed this Jul 19, 2023
@spjmurray spjmurray deleted the couple_new_fields branch July 21, 2023 10:09
@spjmurray
Copy link
Copy Markdown
Contributor Author

Sounds reasonable, can't expect everyone to want to use DeepEqual everywhere. I will await its merger!

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.

openstack flavor show [flavorID] properties

5 participants