(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func TestNewInformerWatcher(t *testing.T) { |
| 137 | // Make sure there are no 2 same types of events on a secret with the same name or that might be flaky. |
| 138 | tt := []struct { |
| 139 | name string |
| 140 | objects []runtime.Object |
| 141 | events []watch.Event |
| 142 | }{ |
| 143 | { |
| 144 | name: "basic test", |
| 145 | objects: []runtime.Object{ |
| 146 | &corev1.Secret{ |
| 147 | ObjectMeta: metav1.ObjectMeta{ |
| 148 | Name: "pod-1", |
| 149 | }, |
| 150 | StringData: map[string]string{ |
| 151 | "foo-1": "initial", |
| 152 | }, |
| 153 | }, |
| 154 | &corev1.Secret{ |
| 155 | ObjectMeta: metav1.ObjectMeta{ |
| 156 | Name: "pod-2", |
| 157 | }, |
| 158 | StringData: map[string]string{ |
| 159 | "foo-2": "initial", |
| 160 | }, |
| 161 | }, |
| 162 | &corev1.Secret{ |
| 163 | ObjectMeta: metav1.ObjectMeta{ |
| 164 | Name: "pod-3", |
| 165 | }, |
| 166 | StringData: map[string]string{ |
| 167 | "foo-3": "initial", |
| 168 | }, |
| 169 | }, |
| 170 | }, |
| 171 | events: []watch.Event{ |
| 172 | { |
| 173 | Type: watch.Added, |
| 174 | Object: &corev1.Secret{ |
| 175 | ObjectMeta: metav1.ObjectMeta{ |
| 176 | Name: "pod-4", |
| 177 | }, |
| 178 | StringData: map[string]string{ |
| 179 | "foo-4": "initial", |
| 180 | }, |
| 181 | }, |
| 182 | }, |
| 183 | { |
| 184 | Type: watch.Modified, |
| 185 | Object: &corev1.Secret{ |
| 186 | ObjectMeta: metav1.ObjectMeta{ |
| 187 | Name: "pod-2", |
| 188 | }, |
| 189 | StringData: map[string]string{ |
| 190 | "foo-2": "new", |
| 191 | }, |
| 192 | }, |
| 193 | }, |
nothing calls this directly
no test coverage detected