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

Move Openstack settings to cloudProvider.openstack #13326

Merged
merged 2 commits into from Apr 10, 2022

Conversation

johngmyers
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 4, 2022
@k8s-ci-robot k8s-ci-robot added area/api area/nodeup area/provider/azure Issues or PRs related to azure provider area/provider/openstack Issues or PRs related to openstack provider labels Mar 4, 2022
@johngmyers
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Mar 4, 2022

@johngmyers: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kops-e2e-cni-amazonvpc be4724c link true /test pull-kops-e2e-cni-amazonvpc

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.

pkg/model/components/openstack.go Outdated Show resolved Hide resolved
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 {
Copy link
Member

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!

Copy link
Member Author

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.

@justinsb
Copy link
Member

justinsb commented Apr 7, 2022

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!

@johngmyers johngmyers changed the title WIP Move Openstack settings to cloudProvider.openstack Move Openstack settings to cloudProvider.openstack Apr 7, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 7, 2022
@johngmyers johngmyers requested review from zetaab and seh April 7, 2022 21:55
Copy link
Member

@zetaab zetaab left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 10, 2022
@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8120147 into kubernetes:master Apr 10, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Apr 10, 2022
@johngmyers johngmyers deleted the move-openstack branch April 11, 2022 16:19
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. area/addons area/api area/nodeup area/provider/azure Issues or PRs related to azure provider area/provider/openstack Issues or PRs related to openstack provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants