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

push headless endpoint change when headless enabled or dns is enabled #42165

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comments
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
ramaraochavali committed Nov 27, 2022
commit e6241a652152240af9ab47ca0882b68ba1acb0b5
12 changes: 10 additions & 2 deletions pilot/pkg/xds/proxy_dependencies.go
Original file line number Diff line number Diff line change
@@ -38,8 +38,7 @@ func ConfigAffectsProxy(req *model.PushRequest, proxy *model.Proxy) bool {
// When endpoints for headless service change, we should push if EnableHeadlessService is true
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I am following.. since this checks Full && ..., wouldn't we push it anyways? The only way we would filter is if it was filtered out by a Sidecar, but in that case we really don't want to push?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you saying full pushes are always pushed? But when we pushConnection, do not we call this for every proxy?

Copy link
Member

Choose a reason for hiding this comment

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

No, it isn't always, but ConfigAffectsProxy scopes based on Sidecar which seems fine...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it a bit. Hopefully that should address this part. PTAL and let me know.

// so that we create updated listeners or when DNSCapture is enabled for proxy so that the NDS
// table is updated.
if req.Full && len(req.Reason) == 1 && req.Reason[0] == model.HeadlessEndpointUpdate &&
(features.EnableHeadlessService || bool(proxy.Metadata.DNSCapture)) {
if req.Full && headlessEndpointsUpdated(req) && (features.EnableHeadlessService || bool(proxy.Metadata.DNSCapture)) {
Copy link
Member

Choose a reason for hiding this comment

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

This may introduce additional full push when EnableHeadlessService = false, actually in this case we only need NDS and EDS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we push NDS only on full push - so this is needed.

Copy link
Member

Choose a reason for hiding this comment

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

How about updating ndsNeedsPush, push nds on headless service endpoint updated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But is n't it the same if headlessendpoints trigger full push whether we do it here or in ndsNeedsPush?

Copy link
Member

Choose a reason for hiding this comment

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

The diff is make full = false and you can set reason = HeadlessEndpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can make full = false because it is needed when EnableHeadlessService is enabled. But changed a bit - hopefully this is better. PTAL

return true
}

@@ -65,6 +64,15 @@ func ConfigAffectsProxy(req *model.PushRequest, proxy *model.Proxy) bool {
return false
}

func headlessEndpointsUpdated(req *model.PushRequest) bool {
for _, reason := range req.Reason {
if reason == model.HeadlessEndpointUpdate {
return true
}
}
return false
}

func checkProxyDependencies(proxy *model.Proxy, config model.ConfigKey, push *model.PushContext) bool {
// Detailed config dependencies check.
switch proxy.Type {