Commit 0116f05
authored
[IUO] Fix webhook test failure for dynamic webhook configurations (RedHatQE#2307)
Fix TypeError in test_webhookconfig_resources when processing webhook │
configurations with null/empty webhooks field. │
│
The test was failing with "TypeError: 'NoneType' object is not subscriptable" │
when iterating over webhook configurations that have no webhooks defined. │
This occurs with Tekton Pipelines/Triggers webhooks (config.webhook.pipeline.tekton.dev │
and config.webhook.triggers.tekton.dev) which use dynamic webhook configuration │
patterns where the ValidatingWebhookConfiguration is created empty and populated │
later by the webhook controller. │
│
Changes: │
- Add null/empty check before accessing webhook_resource.instance.webhooks[0] │
- Log warning with webhook name and type when skipping unconfigured webhooks │
- Prevent test failures in clusters with OpenShift Pipelines installed │
│1 parent 458ea52 commit 0116f05
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
252 | 262 | | |
253 | 263 | | |
254 | 264 | | |
| |||
0 commit comments