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

Replace all uses of Snapshotter with CloudLister #590

Merged
merged 2 commits into from
Jan 11, 2019

Conversation

agau4779
Copy link
Contributor

@agau4779 agau4779 commented Dec 20, 2018

Follow-up to #514 .

Replace the use of /pkg/storage/pools.go (Snapshotter) with a CloudLister interface, to be called as-needed during Garbage Collection. This should reduce the number of calls we make to the GCE API, as well as make GC more reliable.

We will use this for L7 loadbalancers, InstanceGroups, and Backends.

Verified that this properly garbage collects IGs, Backends, and Loadbalancers (TargetProxies, Forwarding Rules, URL Maps) via manual testing

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 20, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @agau4779. Thanks for your PR.

I'm waiting for a kubernetes 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 20, 2018
@rramkumar1
Copy link
Contributor

/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 Dec 20, 2018
@agau4779
Copy link
Contributor Author

/assign @rramkumar1 @bowei

pkg/cloudlist/lister.go Outdated Show resolved Hide resolved
pkg/controller/controller.go Outdated Show resolved Hide resolved
pkg/instances/instances.go Outdated Show resolved Hide resolved
pkg/backends/syncer.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l7s.go Outdated Show resolved Hide resolved
@agau4779 agau4779 force-pushed the listers branch 2 times, most recently from 5ee003d to 676f5e1 Compare January 8, 2019 23:01
pkg/utils/namer_test.go Outdated Show resolved Hide resolved
pkg/cloudlist/lister.go Outdated Show resolved Hide resolved
pkg/cloudlist/lister.go Outdated Show resolved Hide resolved
pkg/cloudlist/lister.go Outdated Show resolved Hide resolved
pkg/cloudlist/lister.go Outdated Show resolved Hide resolved
…ation that is solely used for garbage collection
pkg/backends/backends.go Outdated Show resolved Hide resolved
pkg/controller/controller.go Outdated Show resolved Hide resolved
pkg/instances/instances.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l7.go Show resolved Hide resolved
pkg/loadbalancers/l7s.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l7s.go Show resolved Hide resolved
pkg/utils/namer.go Outdated Show resolved Hide resolved
@rramkumar1
Copy link
Contributor

Also can you squash commits?

pkg/utils/namer.go Show resolved Hide resolved
pkg/utils/namer.go Outdated Show resolved Hide resolved
pkg/loadbalancers/loadbalancers_test.go Show resolved Hide resolved
if len(l) >= 2 {
uid = l[len(l)-1]
}
c := strings.Split(name, "-")
c := strings.Split(l[0], "-")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was there a change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example: k8s-um-test--uid1

The first split above (L208) splits by cluster delimiter (--), giving us ["k8s-um-test", "uid1"]. We need to split the first item of this by - in order to get the NameComponents, which should be ["k8s", "um", "test"]. Previously we split the full name, which gives us ["k8s", "um", "test", "", "", "uid1"], since we only cared about the first two items.

Does this make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some clarifying comments in the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Now that I look at the previous code, I'm surprised it even worked lol.

pkg/loadbalancers/loadbalancers_test.go Outdated Show resolved Hide resolved
add L7 to syncState

simplify cloudlister. use named fields in namer_test

remove Cloudlist interface in favor of List() ([]string, error) method
@rramkumar1
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agau4779, rramkumar1

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 Jan 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 99946cd into kubernetes:master Jan 11, 2019
@agau4779 agau4779 deleted the listers branch January 11, 2019 19:16
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.

None yet

4 participants