-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Integrate federated service DNS record management #25991
Conversation
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
Yeah, I think it is better to get #25517 merged before this one, but that doesn't have to necessarily block reviews on this one. Is this ready for review yet? Also, when it is ready for review, could you please squash your commits into a single commit? I can either see a full-PR-diff view which includes @mfanjie's changes. Or review your changes commit-by-commit but that's painful because you might have something in a commit which you might have fixed 3-commits later and I won't be sure if I have to write the comment now or wait until I see all the commits and go back. Github's PR views don't help here either. Squashing into a single commit makes this somewhat easier. |
Also, please let me know (via Hangouts/email) when this is ready for review. |
@quinton-hoole I checked you changes, and one general comment: |
@@ -1,5 +1,5 @@ | |||
/* | |||
Copyright 2015 The Kubernetes Authors All rights reserved. | |||
Copyright 2016 The Kubernetes Authors All rights reserved. |
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.
I don't think this should change. This file was committed/created in 2015.
Something got screwed up in the merge here, because I've fixed this. Will have to check and retry...
|
@nikhiljindal FYI, as you're doing such a marvellous job of shepherding the cluster federation PR's through the pipeline. |
CLAs look good, thanks! |
@madhusudancs @mfanjie OK, I finally got to rebase this against @26020 and #26034 which merged today. There is still a small amount of cleanup remaining, but unit tests at least pass. I split it into two commits, the first of which is the guts of the logic, and the second is what I had to do to rebase it against #26034. @mfanjie I broke the encapsulation of your helper classes rather embarrassingly to get this working as quickly as possible (see second commit), and thereby unblock integration testing. I'll take a second pass over this and improve on the encapsulation again. I preferred your original :-) |
|
I'll fix this...
|
@quinton-hoole with a squashed commit, I now don't know what changed between the last review and now. Going through the PR again, it will take a while. |
My apologies @madhusudancs. For the most part I followed your advice exactly, the changes for which should be fairly self-evident from the comment above. I replied to each one of your feedback comments individually, so it should be pretty clear exactly what changed. |
Regarding the above gofmt issue, my local gofmt passes that file with flying colors, so I'm not too sure what's going on. I'll have to take a deeper look in the morning.
|
The problem is in this line here - https://github.com/kubernetes/kubernetes/pull/25991/files#diff-2a1f013302ed85314e4e9dc18cd91305R101 Remove clientMap: map[string]*clusterCache{
clusterName: {
cluster: &federation.Cluster{ Also
Is that the go version that your gofmt is picking up? (I mean |
func (s *ServiceController) getClusterZoneNames(clusterName string) (zones []string, region string, err error) { | ||
if client, ok := s.clusterCache.clientMap[clusterName]; !ok { | ||
return nil, "", fmt.Errorf("Cluster cache does not contain entry for cluster %s", clusterName) | ||
} else { |
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.
Why do you need an else
here? if
returns anyway.
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.
Because of golang's variable scoping. client is in the scope of the if/else block. With the else removed, it doesn't compile (client would be undefined). An alternative would be to declare client outside of the address block, but that's way messier than the else statement (and requires explicit typing, which makes the code more brittle).
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.
Fixed as per convention discussed below.
@quinton-hoole finished the second pass. A few questions, some of them at logic/architecture level. |
OK, I figured out the cause of the gofmt error. Locally I had not been passing in the -s "simplify" flag:
|
Thanks @madhusudancs. Addressed all feedback. PTAL. |
and returns a list of IPv4 addresses. If any of the endpoints are neither valid IPv4 addresses nor resolvable DNS names, | ||
non-nil error is also returned (possibly along with a partially complete list of resolved endpoints. | ||
*/ | ||
func getResolvedEndpoints(endpoints []string) ([]string, error) { |
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.
Thanks for extracting this into a function!
@quinton-hoole Only one outstanding comment. Looks good otherwise since some of the comments will be addressed in the follow up PRs. However, thanks for addressing most of the comments. Please feel free to apply the LGTM label after addressing the only remaining comment. |
@madhusudancs Thanks. I pushed an additional commit to fix your last comment. Will squash all commits and add LGTM now. |
GCE e2e build/test passed for commit 80e13ef798a83e1e4bf1548d520e5f7496cc71b4. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 65e1fec. |
Automatic merge from submit-queue |
Integrate federated service DNS record management.