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

Implement multiplexer proxy. #2141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zyjhtangtang
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Implement the shared cache module in node-level traffic multiplexing, referencing the Design Proposal.

Does this PR introduce a user-facing change?

"NONE"

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 48.29612% with 440 lines in your changes missing coverage. Please review.

Project coverage is 45.13%. Comparing base (7763e7c) to head (d6c4a47).
Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
.../yurthub/proxy/multiplexer/watchembeddedencoder.go 10.66% 130 Missing and 4 partials ⚠️
pkg/yurthub/proxy/multiplexer/multiplexerwatch.go 51.21% 43 Missing and 17 partials ⚠️
pkg/yurthub/multiplexer/storage/fake_storage.go 0.00% 49 Missing ⚠️
pkg/yurthub/proxy/multiplexer/multiplexerlist.go 51.42% 19 Missing and 15 partials ⚠️
pkg/yurthub/proxy/multiplexer/multiplexerproxy.go 72.95% 21 Missing and 12 partials ⚠️
pkg/yurthub/multiplexer/manager.go 73.33% 10 Missing and 10 partials ⚠️
pkg/yurthub/proxy/util/util.go 0.00% 19 Missing ⚠️
pkg/yurthub/filter/interfaces.go 0.00% 13 Missing ⚠️
pkg/yurthub/proxy/proxy.go 0.00% 13 Missing ⚠️
pkg/yurthub/filter/manager/manager.go 0.00% 10 Missing ⚠️
... and 11 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2141       +/-   ##
===========================================
- Coverage   58.93%   45.13%   -13.81%     
===========================================
  Files         210      418      +208     
  Lines       18968    28552     +9584     
===========================================
+ Hits        11179    12887     +1708     
- Misses       6707    14373     +7666     
- Partials     1082     1292      +210     
Flag Coverage Δ
unittests 45.13% <48.29%> (-13.81%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Sep 14, 2024


return &multiplexerManager{
restStoreManager: restStoreManager,
restMapper: kmeta.NewDefaultRESTMapperFromScheme(),
Copy link
Member

Choose a reason for hiding this comment

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

The RestScope in kmeta.NewDefaultRESTMapperFromScheme() is fixed as namespace as following, I think we need to improve kmeta.NewDefaultRESTMapperFromScheme() for multiplexer.

scope := meta.RESTScopeNamespace

@zyjhtangtang zyjhtangtang changed the title Implement shared cache. Implement multiplexer proxy. Nov 13, 2024
@@ -86,13 +86,15 @@ const (
CacheUserAgentsKey = "cache_agents"
PoolScopeResourcesKey = "pool_scope_resources"

MultiplexerProxyClientUserAgent = "multiplexer-proxy"
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 name MultiplexerProxyClientUserAgent to fmt.Sprintf("multiplexer-proxy-%s", strings.ToLower(nodeName))?

}

func (sm *storageManager) restClient(gvr *schema.GroupVersionResource) (rest.Interface, error) {
httpClient, _ := rest.HTTPClientFor(sm.config)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should not skip err here

Copy link

sonarcloud bot commented Nov 23, 2024

return nil, errors.Wrapf(err, "failed to get rest client for %v", gvr)
}

rs := &store{
Copy link
Member

Choose a reason for hiding this comment

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

rs := NewStore(restClient, gvr.Resource)

}
}

func (rs *store) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
Copy link
Member

Choose a reason for hiding this comment

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

paramter key is unused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants