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

✨Service interface load balancer #1119

Conversation

mgrote
Copy link
Contributor

@mgrote mgrote commented Jan 24, 2022

What this PR does / why we need it:

For better testability it is useful to abstract a service interface for loadbalancers. That interface could be easily mocked e.g. with gomock for propper testing.
The same was already done for pkg/cloud/services/networking in #935.

Which issue(s) this PR fixes
Fixes #1120

Special notes for your reviewer:

TODOs:

  • squashed commits
  • adds unit tests

/hold

Michael Grote [email protected], Daimler TSS GmbH, Provider Information

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2022
@netlify
Copy link

netlify bot commented Jan 24, 2022

✔️ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

🔨 Explore the source changes: af897fc

🔍 Inspect the deploy log: https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/61efd981b0837e000898a317

😎 Browse the preview: https://deploy-preview-1119--kubernetes-sigs-cluster-api-openstack.netlify.app

@k8s-ci-robot
Copy link
Contributor

Hi @mgrote. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 24, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 24, 2022
@tobiasgiese
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 24, 2022
@mgrote mgrote changed the title ✨[WIP] Mgrote/service interface load balancer ✨Service interface load balancer Jan 24, 2022
Copy link
Contributor

@seanschneeweiss seanschneeweiss left a comment

Choose a reason for hiding this comment

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

This is great. Helps a lot with testing and makes the load balancer code more readable by moving out the metrics context calls.

pkg/cloud/services/loadbalancer/client.go Outdated Show resolved Hide resolved
pkg/cloud/services/loadbalancer/client.go Show resolved Hide resolved
pkg/cloud/services/loadbalancer/client.go Show resolved Hide resolved
pkg/cloud/services/loadbalancer/service.go Outdated Show resolved Hide resolved
@mgrote mgrote force-pushed the mgrote/service-interface-load-balancer branch 3 times, most recently from 5be2fc7 to eacdbd5 Compare January 24, 2022 15:54
@jichenjc
Copy link
Contributor

mostly good , fix the pull-cluster-api-provider-openstack-test error we should be ready to go

@mgrote mgrote force-pushed the mgrote/service-interface-load-balancer branch from eacdbd5 to af897fc Compare January 25, 2022 11:05
Copy link
Contributor

@seanschneeweiss seanschneeweiss left a comment

Choose a reason for hiding this comment

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

/lgtm

Thank you for updating the boilerplate.generatego.txt.

The previous test failed as the image used by Prow uses Go version 1.17.6.

After @mgrote updated to Go version 1.17, the generated files were accepted by the test.

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

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/approve

Great job, also for handling the boilerplate header :-)

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

mdbooth commented Jan 28, 2022

This looks great!
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi, mdbooth, mgrote

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

@mgrote
Copy link
Contributor Author

mgrote commented Jan 31, 2022

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 31, 2022
@k8s-ci-robot k8s-ci-robot merged commit 506931f into kubernetes-sigs:main Jan 31, 2022
@mdbooth mdbooth mentioned this pull request Feb 7, 2022
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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a service interface for package pkg/cloud/services/loadbalancer
7 participants