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

improve data filter framework #1025

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

rambohe-ch
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind enhancement

What this PR does:

improve data filter setting format in configmap kube-system/yurthub-cfg in order to leverage end users configure filter setting conveniently.

take servicetopology filter as an example:

  • original setting
    filter_servicetopology: "user-agent1/resource#verb1;verb2, user-agent2/resource#verb1;verb2"

  • improved setting
    servicetopology: "user-agent1, user-agent2"

by the way, the original setting format is also supported in order to keep consistency.

Why we need it:

because which resource and verbs of requests are supported is fixed by filter, for example, servicetopology filter can only support requests witch list/watch endpoints and endpointslices. so it's no need for end users to configure info of resource and verbs.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Components on the edge nodes that want to use data filter framework, the way of configuring filter setting in configmap `kube-system/yurthub-cfg` is changed, the detail info is explained above.

other Note

@openyurt-bot
Copy link
Collaborator

@rambohe-ch: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind enhancement

What this PR does:

improve data filter setting format in configmap kube-system/yurthub-cfg in order to leverage end users configure filter setting conveniently.

take servicetopology filter as an example:

  • original setting
    filter_servicetopology: "user-agent1/resource#verb1;verb2, user-agent2/resource#verb1;verb2"

  • improved setting
    servicetopology: "user-agent1, user-agent2"

by the way, the original setting format is also supported in order to keep consistency.

Why we need it:

because which resource and verbs of requests are supported is fixed by filter, for example, servicetopology filter can only support requests witch list/watch endpoints and endpointslices. so it's no need for end users to configure info of resource and verbs.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Components on the edge nodes that want to use data filter framework, the way of configuring filter setting in configmap `kube-system/yurthub-cfg` is changed, the detail info is explained above.

other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot openyurt-bot added the kind/enhancement kind/enhancement label Oct 9, 2022
@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rambohe-ch

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rambohe-ch
Copy link
Member Author

/assign @yingjianjian @Congrool @zzguang

@openyurt-bot
Copy link
Collaborator

@rambohe-ch: GitHub didn't allow me to assign the following users: yingjianjian, zzguang.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @yingjianjian @Congrool @zzguang

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Oct 9, 2022

Codecov Report

Merging #1025 (916ddd6) into master (5a7b856) will increase coverage by 0.43%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #1025      +/-   ##
==========================================
+ Coverage   47.73%   48.17%   +0.43%     
==========================================
  Files          95       95              
  Lines       13004    13010       +6     
==========================================
+ Hits         6208     6267      +59     
+ Misses       6263     6208      -55     
- Partials      533      535       +2     
Flag Coverage Δ
unittests 48.17% <66.66%> (+0.43%) ⬆️

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

Impacted Files Coverage Δ
pkg/yurthub/filter/discardcloudservice/filter.go 0.00% <0.00%> (ø)
pkg/yurthub/filter/filter.go 0.00% <0.00%> (ø)
pkg/yurthub/filter/masterservice/filter.go 0.00% <0.00%> (ø)
pkg/yurthub/filter/masterservice/handler.go 75.80% <ø> (-0.39%) ⬇️
pkg/yurthub/filter/servicetopology/filter.go 0.00% <0.00%> (ø)
pkg/yurthub/proxy/remote/loadbalancer.go 40.00% <ø> (ø)
pkg/yurthub/proxy/remote/remote.go 1.34% <0.00%> (ø)
pkg/yurthub/filter/manager/manager.go 75.47% <75.47%> (ø)
pkg/yurthub/filter/approver.go 85.23% <94.73%> (+9.57%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@yingjianjian
Copy link
Member

/lgtm

@openyurt-bot
Copy link
Collaborator

@yingjianjian: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

pkg/yurthub/filter/manager/manager.go Outdated Show resolved Hide resolved
pkg/yurthub/filter/approver.go Show resolved Hide resolved
@Congrool
Copy link
Member

some little revisions are needed, otherwise LGTM

@rambohe-ch rambohe-ch force-pushed the improve-filter-framework branch from 0e3f691 to 7ba02a5 Compare October 14, 2022 06:21
@rambohe-ch rambohe-ch force-pushed the improve-filter-framework branch from 7ba02a5 to 916ddd6 Compare October 14, 2022 06:25
@Congrool
Copy link
Member

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Oct 14, 2022
@openyurt-bot openyurt-bot merged commit 0cedfbb into openyurtio:master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants