-
Notifications
You must be signed in to change notification settings - Fork 299
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
Change return type of AggregatedListNetworkEndpointGroup in cloudprovideradapter. #938
Conversation
/assign @freehan This implements the review comment in |
pkg/neg/manager.go
Outdated
@@ -255,17 +255,23 @@ func (manager *syncerManager) garbageCollectSyncer() { | |||
func (manager *syncerManager) garbageCollectNEG() error { | |||
// Retrieve aggregated NEG list from cloud | |||
// Compare against svcPortMap and Remove unintended NEGs by best effort | |||
zoneNEGList, err := manager.cloud.AggregatedListNetworkEndpointGroup(meta.VersionGA) | |||
NEGList, err := manager.cloud.AggregatedListNetworkEndpointGroup(meta.VersionGA) |
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.
nit: negList
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.
done
pkg/neg/manager.go
Outdated
} | ||
negNames := map[string]string{} | ||
for key, neg := range NEGList { | ||
if key.Type() == meta.Global { |
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.
Do this instead?
if key.Type() != meta.Zonal
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.
done
pkg/neg/manager.go
Outdated
if manager.namer.IsNEG(neg.Name) { | ||
negNames.Insert(neg.Name) | ||
} | ||
negNames := map[string]string{} |
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 think negName->zone is not enough.
there may be multiple NEGs with the same name in multiple zones.
// negName -> zones
deleteCandidates := map[string][]string
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.
Good point, added this and a test case.
pkg/neg/manager.go
Outdated
continue | ||
} | ||
if manager.namer.IsNEG(neg.Name) { | ||
negNames[neg.Name] = key.Zone |
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.
if _, ok := deleteCandidates[key.Name]; !ok {
deleteCandidates[key.Name] = []string{}
}
deleteCandidates[key.Name] = deleteCandidates[key.Name].append(key.Zone)
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.
done
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.
LGTM
just one nit.
for _, neg := range list { | ||
if manager.namer.IsNEG(neg.Name) { | ||
negNames.Insert(neg.Name) | ||
deleteCandidates := map[string][]string{} |
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.
nit: add a comment
// deleteCandidates is a map from neg name to list of zones it is in.
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, prameshj 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 |
No description provided.