|
67 | 67 | "metadata": map[string]interface{}{
|
68 | 68 | "name": "Bar3",
|
69 | 69 | "namespace": "ns3",
|
70 |
| - "resourceVersion": 1, |
| 70 | + "resourceVersion": "1", |
| 71 | + "uid": "00000000-0000-0000-0000-000000000042", |
| 72 | + "selfLink": "shouldnotbethere", |
| 73 | + }, |
| 74 | + "status": "shouldnotbethere", |
| 75 | + }, |
| 76 | + } |
| 77 | + |
| 78 | + obj4 = &unstructured.Unstructured{ |
| 79 | + Object: map[string]interface{}{ |
| 80 | + "apiVersion": "v1", |
| 81 | + "kind": "Foo2", |
| 82 | + "metadata": map[string]interface{}{ |
| 83 | + "name": "Bar4", |
| 84 | + "namespace": "ns4", |
| 85 | + "resourceVersion": "2", |
| 86 | + "foo": "canary-bar4", |
| 87 | + "uid": "00000000-0000-0000-0000-000000000042", |
| 88 | + "selfLink": "shouldnotbethere", |
| 89 | + }, |
| 90 | + "status": "shouldnotbethere", |
| 91 | + }, |
| 92 | + } |
| 93 | + |
| 94 | + obj5 = &unstructured.Unstructured{ |
| 95 | + Object: map[string]interface{}{ |
| 96 | + "apiVersion": "v1", |
| 97 | + "kind": "Foo2", |
| 98 | + "metadata": map[string]interface{}{ |
| 99 | + "name": "Bar4", |
| 100 | + "namespace": "ns4", |
| 101 | + "ResourceVersion": "4", |
| 102 | + "foo": "canary-bar5", |
71 | 103 | "uid": "00000000-0000-0000-0000-000000000042",
|
72 | 104 | "selfLink": "shouldnotbethere",
|
73 | 105 | },
|
@@ -95,6 +127,8 @@ func TestController(t *testing.T) {
|
95 | 127 |
|
96 | 128 | client.Add(obj2)
|
97 | 129 | client.Add(obj3)
|
| 130 | + client.Add(obj4) |
| 131 | + client.Modify(obj5) |
98 | 132 |
|
99 | 133 | ctrl.Start()
|
100 | 134 | // wait until queue is drained
|
@@ -123,6 +157,11 @@ func TestController(t *testing.T) {
|
123 | 157 | if strings.Compare(ev.Key, "ns3/Bar3") == 0 {
|
124 | 158 | t.Error("execludedobject filter failed")
|
125 | 159 | }
|
| 160 | + |
| 161 | + // ensure updates propagate |
| 162 | + if strings.Contains(string(ev.Object), "canary-bar4") { |
| 163 | + t.Error("update didn't propagate") |
| 164 | + } |
126 | 165 | }
|
127 | 166 |
|
128 | 167 | if !gotFoo2 {
|
|
0 commit comments