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
Move Openstack settings to cloudProvider.openstack #13326
Conversation
7d61030
to
1e7ab14
Compare
1e7ab14
to
be4724c
Compare
/retest |
@johngmyers: The following test 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. |
b.Cluster.Spec.CloudConfig.Openstack != nil && | ||
b.Cluster.Spec.CloudConfig.Openstack.Loadbalancer != nil { | ||
return fi.BoolValue(b.Cluster.Spec.CloudConfig.Openstack.Loadbalancer.UseOctavia) | ||
if b.Cluster.Spec.CloudProvider.Openstack.Loadbalancer != nil { |
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.
Did we lose the nil checks here?
One thing we could do is introduce nil-safe getters, like GetOpenstack()
, which would look a bit like this:
func (c *CloudProvider) GetOpenstack() *OpenStack {
if c == nil {
return nil
}
return c.Openstack
}
Or alternatively:
func (c *CloudProvider) GetOpenstack() *Openstack {
if c == nil || c.Openstack == nil {
return &Openstack{}
}
return c.Openstack
}
The virtue of the second one is that it forces us to not rely on nil as being meaningful. Of course that's a fairly significant change, but it might be a good thing to think about for v1alpha3!
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.
This ModelBuilder won't even be instantiated unless Spec.CloudProvider.Openstack
is non-nil
.
One nit and a few ideas, but LGTM from a code perspective. We should get OpenStack folk to look at this before merging though :-) But looks really good for a WIP! |
be4724c
to
aff5f58
Compare
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.
for me this looks ok
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zetaab 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 |
No description provided.