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

OpenStack: Use correct type to unmarshal clouds #3000

Merged
merged 1 commit into from Jan 29, 2020

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jan 28, 2020

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

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 28, 2020
@Fedosin Fedosin force-pushed the otherclouds branch 2 times, most recently from 54a3a38 to 59ae7a8 Compare January 28, 2020 11:30
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2020
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
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 28, 2020
@Fedosin Fedosin changed the title OpenStack: Read cloud names from other locations OpenStack: Use correct type to unmarshal clouds Jan 28, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

@fabianofranz PTAL :)

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

/retest

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

/retest

}

func loadAndLog(fn func() (string, []byte, error)) (map[string]clientconfig.Cloud, error) {
func loadAndLog(fn func() (string, []byte, error)) ([]byte, error) {

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

Copy link
Contributor Author

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

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

@iamemilio
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 28, 2020

/approve

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2020
@openshift-ci-robot
Copy link
Contributor

@Fedosin: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-fips 1b72478 link /test e2e-aws-fips
ci/prow/e2e-libvirt 1b72478 link /test e2e-libvirt
ci/prow/e2e-aws-scaleup-rhel7 1b72478 link /test e2e-aws-scaleup-rhel7

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.

@openshift-merge-robot openshift-merge-robot merged commit 1cc6935 into openshift:master Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openstack - create install-config failed to fetch dependency of "Base Domain"
4 participants