Closed G-Harmon closed 6 years ago
Hi @G-Harmon. 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.
I understand the commands that are listed here.
This can't be merged until https://github.com/kubernetes/ingress-gce/pull/78 is merged, AND we re-vendor that commit into this repo.
/ok-to-test
The test failure is expected here, since it doesn't have the updates I made to ingress-gce.
Thanks @G-Harmon looks great, main comment is about who should do formatting for printing.
Also needs rebase with #93
PTAL. sorry it was a little messy, I was a bit rushed last night. I wanted to get your review comments, so thanks for looking at it!
Review status: 0 of 10 files reviewed at latest revision, 12 unresolved discussions.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer.go, line 133 at r1 (raw file):
Returned error and printed error should be same? ``` err = fmt.Errorf("Error getting global forwarding rules: %s", err) fmt.Println(err) return err ```
I kind of go back and forth on this point, but I think you're right. (The only downside is that we will likely print the exact same error twice. That's probably better than printing 2 slightly different messages for the same problem.)
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer.go, line 136 at r1 (raw file):
What do you mean? Filter out nil rules?
When I first started using the Fake, I had the Fake's ListGlobalForwardingRules returning nil. That crashed this code. I haven't seen a nil return from the real one.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer.go, line 141 at r1 (raw file):
Shouldnt we return this error as well?
sure. (I was thinking better to get partial status than none.) Now I return "result" and the error. Is that an okay pattern?
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer_test.go, line 118 at r1 (raw file):
You meant TestGetForwardingRules?
now it's TestListLoadBalancerStatuses.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer_test.go, line 139 at r1 (raw file):
"unexpected name, expected: %s, actual: %s"
oops, I meant to come back to these Errorfs, but forgot! Done.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer_test.go, line 142 at r1 (raw file):
same as above
Done.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer_test.go, line 211 at r1 (raw file):
load balancers -> forwarding rules :)
Done.
app/kubemci/pkg/gcp/forwardingrule/forwardingrulesyncer_test.go, line 214 at r1 (raw file):
nit: add space after :
Done.
app/kubemci/pkg/gcp/forwardingrule/interfaces.go, line 32 at r1 (raw file):
How about calling this ListLoadBalancerStatuses? From GetForwardingRules, I expect it to return compute.ForwardingRule.
yea, done.
app/kubemci/pkg/gcp/loadbalancer/loadbalancersyncer.go, line 223 at r1 (raw file):
how about calling this formatLoadBalancersList? This method does not know that load balancer statuses came from forwarding rules and hence should have nothing to do with forwarding rules.
Done. makes sense.
app/kubemci/pkg/gcp/loadbalancer/loadbalancersyncer.go, line 225 at r1 (raw file):
call it multicluster ingresses instead of multicluster loadbalancers (since we call them mci's everywhere)?
right :)
app/kubemci/pkg/gcp/loadbalancer/loadbalancersyncer.go, line 227 at r1 (raw file):
unintended?
Done. (removed)
Comments from Reviewable
Thanks for the fixes, looks great! Added 2 comments
test failed due to trivial merge conflict. I fixed it and pushed an update.
/lgtm, thanks!
cc @nikhiljindal @csbell @madhusudancs
This change is