Add 'source' to events field selector.

This commit is contained in:
Daniel Smith
2014-11-10 17:46:40 -08:00
parent d6d6229fea
commit f1b0b64a75
2 changed files with 7 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ func TestRESTgetAttrs(t *testing.T) {
InvolvedObject: api.ObjectReference{
Kind: "Pod",
Name: "foo",
Namespace: "baz",
UID: "long uid string",
APIVersion: testapi.Version(),
ResourceVersion: "0",
@@ -105,6 +106,7 @@ func TestRESTgetAttrs(t *testing.T) {
},
Status: "tested",
Reason: "forTesting",
Source: "test",
}
label, field, err := rest.getAttrs(eventA)
if err != nil {
@@ -116,12 +118,14 @@ func TestRESTgetAttrs(t *testing.T) {
expect := labels.Set{
"involvedObject.kind": "Pod",
"involvedObject.name": "foo",
"involvedObject.namespace": "baz",
"involvedObject.uid": "long uid string",
"involvedObject.apiVersion": testapi.Version(),
"involvedObject.resourceVersion": "0",
"involvedObject.fieldPath": "",
"status": "tested",
"reason": "forTesting",
"source": "test",
}
if e, a := expect, field; !reflect.DeepEqual(e, a) {
t.Errorf("diff: %s", util.ObjectDiff(e, a))