Merge pull request #67809 from Pingan2017/dafaultfitler

Automatic merge from submit-queue (batch tested with PRs 67362, 67256, 67809). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

del unused func DefaultEventFilterFunc

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

Kubernetes-commit: da62c170f724277bae45f6efed6085eb34566bc5
This commit is contained in:
Kubernetes Publisher 2018-08-27 07:38:04 -07:00
commit 030d971055
3 changed files with 31 additions and 44 deletions

62
Godeps/Godeps.json generated
View File

@ -272,127 +272,127 @@
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1", "ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1beta1", "ImportPath": "k8s.io/api/admissionregistration/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1", "ImportPath": "k8s.io/api/apps/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta1", "ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta2", "ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1", "ImportPath": "k8s.io/api/authentication/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1beta1", "ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1", "ImportPath": "k8s.io/api/authorization/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1beta1", "ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v1", "ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v2beta1", "ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1", "ImportPath": "k8s.io/api/batch/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1beta1", "ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v2alpha1", "ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/certificates/v1beta1", "ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/coordination/v1beta1", "ImportPath": "k8s.io/api/coordination/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/core/v1", "ImportPath": "k8s.io/api/core/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/events/v1beta1", "ImportPath": "k8s.io/api/events/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/extensions/v1beta1", "ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1", "ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/networking/v1", "ImportPath": "k8s.io/api/networking/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/policy/v1beta1", "ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1", "ImportPath": "k8s.io/api/rbac/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1alpha1", "ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1beta1", "ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1alpha1", "ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1beta1", "ImportPath": "k8s.io/api/scheduling/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/settings/v1alpha1", "ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1", "ImportPath": "k8s.io/api/storage/v1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1alpha1", "ImportPath": "k8s.io/api/storage/v1alpha1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1beta1", "ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "644117120187a38be1542f4598cbcf7a1b19a015" "Rev": "6b5087e2523690a4b64865c7359d157b4eb5817f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",

View File

@ -84,11 +84,6 @@ func getSpamKey(event *v1.Event) string {
// EventFilterFunc is a function that returns true if the event should be skipped // EventFilterFunc is a function that returns true if the event should be skipped
type EventFilterFunc func(event *v1.Event) bool type EventFilterFunc func(event *v1.Event) bool
// DefaultEventFilterFunc returns false for all incoming events
func DefaultEventFilterFunc(event *v1.Event) bool {
return false
}
// EventSourceObjectSpamFilter is responsible for throttling // EventSourceObjectSpamFilter is responsible for throttling
// the amount of events a source and object can produce. // the amount of events a source and object can produce.
type EventSourceObjectSpamFilter struct { type EventSourceObjectSpamFilter struct {

View File

@ -127,14 +127,6 @@ func validateEvent(messagePrefix string, actualEvent *v1.Event, expectedEvent *v
return actualEvent, nil return actualEvent, nil
} }
// TestDefaultEventFilterFunc ensures that no events are filtered
func TestDefaultEventFilterFunc(t *testing.T) {
event := makeEvent("end-of-world", "it was fun", makeObjectReference("Pod", "pod1", "other"))
if DefaultEventFilterFunc(&event) {
t.Fatalf("DefaultEventFilterFunc should always return false")
}
}
// TestEventAggregatorByReasonFunc ensures that two events are aggregated if they vary only by event.message // TestEventAggregatorByReasonFunc ensures that two events are aggregated if they vary only by event.message
func TestEventAggregatorByReasonFunc(t *testing.T) { func TestEventAggregatorByReasonFunc(t *testing.T) {
event1 := makeEvent("end-of-world", "it was fun", makeObjectReference("Pod", "pod1", "other")) event1 := makeEvent("end-of-world", "it was fun", makeObjectReference("Pod", "pod1", "other"))