Skip to content

Commit

Permalink
merge endpoints filter into service topology filter (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
rambohe-ch authored Aug 25, 2022
1 parent 27514fc commit 277c2eb
Show file tree
Hide file tree
Showing 8 changed files with 1,603 additions and 687 deletions.
2 changes: 0 additions & 2 deletions cmd/yurthub/app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
"github.com/openyurtio/openyurt/pkg/yurthub/cachemanager"
"github.com/openyurtio/openyurt/pkg/yurthub/filter"
"github.com/openyurtio/openyurt/pkg/yurthub/filter/discardcloudservice"
"github.com/openyurtio/openyurt/pkg/yurthub/filter/endpointsfilter"
"github.com/openyurtio/openyurt/pkg/yurthub/filter/initializer"
"github.com/openyurtio/openyurt/pkg/yurthub/filter/masterservice"
"github.com/openyurtio/openyurt/pkg/yurthub/filter/servicetopology"
Expand Down Expand Up @@ -297,7 +296,6 @@ func registerAllFilters(filters *filter.Filters) {
servicetopology.Register(filters)
masterservice.Register(filters)
discardcloudservice.Register(filters)
endpointsfilter.Register(filters)
}

// generateNameToFilterMapping return union filters that initializations completed.
Expand Down
4 changes: 2 additions & 2 deletions pkg/yurthub/filter/approver.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ var (
defaultReqKeyToName = map[string]string{
reqKey("kubelet", "services", "list"): MasterServiceFilterName,
reqKey("kubelet", "services", "watch"): MasterServiceFilterName,
reqKey("nginx-ingress-controller", "endpoints", "list"): EndpointsFilterName,
reqKey("nginx-ingress-controller", "endpoints", "watch"): EndpointsFilterName,
reqKey("kube-proxy", "services", "list"): DiscardCloudServiceFilterName,
reqKey("kube-proxy", "services", "watch"): DiscardCloudServiceFilterName,
reqKey("nginx-ingress-controller", "endpoints", "list"): ServiceTopologyFilterName,
reqKey("nginx-ingress-controller", "endpoints", "watch"): ServiceTopologyFilterName,
reqKey("kube-proxy", "endpointslices", "list"): ServiceTopologyFilterName,
reqKey("kube-proxy", "endpointslices", "watch"): ServiceTopologyFilterName,
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/yurthub/filter/approver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ func TestGetFilterName(t *testing.T) {
userAgent: "nginx-ingress-controller/v1.1.0",
verb: "GET",
path: "/api/v1/endpoints",
resultFilter: EndpointsFilterName,
resultFilter: ServiceTopologyFilterName,
},
"nginx-ingress-controller watch endpoints": {
userAgent: "nginx-ingress-controller/v1.1.0",
verb: "GET",
path: "/api/v1/endpoints?watch=true",
resultFilter: EndpointsFilterName,
resultFilter: ServiceTopologyFilterName,
},
"list endpoints without user agent": {
verb: "GET",
Expand Down
4 changes: 0 additions & 4 deletions pkg/yurthub/filter/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ const (
// If end users want to use specified LB service at the edge side,
// End users should add annotation["openyurt.io/skip-discard"]="true" for LB service.
SkipDiscardServiceAnnotation = "openyurt.io/skip-discard"

// EndpointsFilterName is used to reassemble endpoints in order to make the data traffic be
// load balanced only to the nodepool valid endpoints.
EndpointsFilterName = "endpoints"
)

// DisabledInCloudMode contains the filters that should be disabled when yurthub is working in cloud mode.
Expand Down
156 changes: 0 additions & 156 deletions pkg/yurthub/filter/endpointsfilter/filter.go

This file was deleted.

174 changes: 0 additions & 174 deletions pkg/yurthub/filter/endpointsfilter/handler.go

This file was deleted.

Loading

0 comments on commit 277c2eb

Please sign in to comment.