Commit 8fc0388
authored
[v0.12] Fix namespace label equality check and nil map panic (#5175)
* Fix namespace label equality check before update
Compare the computed desired state against the current namespace
labels and annotations instead of comparing raw options directly.
The previous reflect.DeepEqual check could never return true because
ns.Labels always includes kubernetes.io/metadata.name (and now also
preserved pod-security labels), causing an unnecessary updateNamespace
call on every reconcile even when no label changes were needed.
* Fix nil map panic and update addLabelsFromOptions doc comment
addLabelsFromOptions panics when ns.Labels is nil (maps.Clone returns
nil) and NamespaceLabels options are non-nil. Add the same nil guard
already present for annotations.
Update the function doc comment to reflect the actual label retention
rules: options labels, kubernetes.io/metadata.name, and existing
pod-security.kubernetes.io/* labels are preserved; pod-security labels
from options are ignored.
* Retry on conflict in HelmURLRegex migration test
The controller updates GitRepo status concurrently during integration
tests, bumping the resource version between the test's Get and Update
calls. Wrap the manual reset in Eventually to retry on conflict.1 parent f443e83 commit 8fc0388
2 files changed
Lines changed: 27 additions & 18 deletions
File tree
- integrationtests/gitjob/controller
- internal/cmd/agent/deployer
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 185 | + | |
189 | 186 | | |
190 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | | - | |
194 | | - | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | | - | |
| 197 | + | |
197 | 198 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
| |||
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
230 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
| |||
0 commit comments