Skip to content
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

v2: Add ParseOption type to made clouds.Parse() more usable for optional With* funcs #2914

Conversation

vooon
Copy link
Contributor

@vooon vooon commented Feb 13, 2024

So that makes easier to have conditional With like that:

https://github.com/sardinasystems/fleeting-plugin-openstack/blob/90c744fc9ee23d8a18dad96f2a677a9d1a54222c/provider.go#L44-L52

Fixes #2913

In addition it fixes search for default /etc/openstack/clouds.yaml file.

That fix following error returned by Parse():
```
Failed to parse clouds.yaml: yaml: input error: read /etc/openstack: is a directory
```

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Fix gophercloud#2913

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting your first PR! Be sure that we will be looking at it but keep in mind
this sometimes takes a while.
Please let the maintainers know if your PR has not got enough attention after a few days.
If any doubt, please consult our PR tutorial.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Feb 13, 2024
@vooon vooon changed the title v2: Add ParseOption type to mage clouds.Parse() more usable for optional With* funcs v2: Add ParseOption type to made clouds.Parse() more usable for optional With* funcs Feb 13, 2024
@pierreprinetti
Copy link
Contributor

pierreprinetti commented Feb 13, 2024

I understand that it can be useful to conditionally add functional options, and indeed I can't find a straightforward way of allowing that without exposing the options type. Thank you @vooon for your contribution.

@pierreprinetti pierreprinetti self-assigned this Feb 13, 2024
@pierreprinetti pierreprinetti added the backport-v1 This PR will be backported to v1 label Feb 13, 2024
@coveralls
Copy link

Coverage Status

coverage: 77.233%. remained the same
when pulling 5d62d9c on sardinasystems:ss-fix-default-clouds-location
into c287220 on gophercloud:master.

@vooon
Copy link
Contributor Author

vooon commented Feb 13, 2024

@pierreprinetti that's quite common way doing With*, for example grpc.DialOption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v1 This PR will be backported to v1 semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2: Export a slice of clouds config opts
4 participants