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
OpenStack: Use correct type to unmarshal clouds #3000
Conversation
54a3a38
to
59ae7a8
Compare
/hold |
Now, to unmarshal clouds from yaml files we always use type Clouds https://github.com/gophercloud/utils/blob/master/openstack/clientconfig/results.go#L10-L15 But this is wrong because for clouds-public.yaml we should use PublicClouds https://github.com/gophercloud/utils/blob/master/openstack/clientconfig/results.go#L3-L8 otherwise LoadPublicCloudsYAML function always returns an empty map. Fixes: openshift#2997
/hold cancel |
@fabianofranz PTAL :) |
/retest |
1 similar comment
/retest |
} | ||
|
||
func loadAndLog(fn func() (string, []byte, error)) (map[string]clientconfig.Cloud, error) { | ||
func loadAndLog(fn func() (string, []byte, error)) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing the return type to []byte? All LoadXCloudsYaml() functions return map[string]Cloud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now in loadAndLog
function we always unmarshal data to clientconfig.Clouds
type, but this is wrong, because for clouds-public.yaml
we must use clientconfig.PublicClouds
, otherwise the result will be empty and the installation fail.
To avoid this I decided to keep only loading of content and logging in loadAndLog
, and move the unmarshaling to the upper level.
In LoadCloudsYAML
and LoadSecureCloudsYAML
we continue to unmarshal to clientconfig.Clouds
, but for LoadPublicCloudsYAML
we now use clientconfig.PublicClouds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, I follow now
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Fedosin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Fedosin: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Now, to unmarshal clouds from yaml files we always use type
Clouds
https://github.com/gophercloud/utils/blob/master/openstack/clientconfig/results.go#L10-L15
But this is wrong because for clouds-public.yaml we should use
PublicClouds
https://github.com/gophercloud/utils/blob/master/openstack/clientconfig/results.go#L3-L8
otherwise
LoadPublicCloudsYAML
function always returns an empty map.Fixes: #2997