Repository navigation
Commit 1602b76
Enable conversion webhook activation in the bindata pipeline
Generalise sync-bindata.sh and the openstack-operator controller to
activate the webhook server and stage the serving resources for any
service operator that carries a conversion webhook in its CRD, without
hardcoding operator names.
sync-bindata.sh:
- Add write_webhook_serving_resources: generates only the webhook
Service + Certificate (no admission webhook configs). Used for
operators whose CRs are created by the OpenStackControlPlane
reconciler, so direct-user admission webhooks are not needed; the
conversion endpoint is.
- Refactor write_webhooks to call write_webhook_serving_resources for
the serving resources and append admission configs via cat >>. Output
for infra-operator and openstack-baremetal-operator is unchanged.
- Add csv_has_conversion_crd: inspects the owned CRDs listed in a CSV
and returns true if any carries spec.conversion.strategy: Webhook.
Warns on stderr if an expected CRD file is absent.
- Extend the webhook generation gate: infra/baremetal remain hardcoded
(admission operators); any other operator whose CRD declares a
conversion webhook now gets write_webhook_serving_resources called
automatically (data-driven, keystone-first).
openstack_controller.go:
- Add webhookOperatorSet field to OpenStackReconciler, populated once
in SetupWithManager by globbing bindata/operator/*-webhooks.yaml.
Zero filesystem reads on subsequent reconciles.
- ENABLE_WEBHOOKS default case: checks webhookOperatorSet instead of a
hardcoded name. Conversion operators (e.g. keystone) flip to true
once their webhook manifest is staged; infra/baremetal remain
hardcoded in their switch cases.
- Replace the static isWebhookEndpoint allowlist with webhookServiceNames,
a method that derives endpoint names from webhookOperatorSet at
runtime. Adding a new conversion operator requires only publishing the
bundle and running make bindata — no code change.
Jira: OSPRH-30210
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>1 parent b703e9c commit 1602b76
2 files changed
Lines changed: 116 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 47 | + | |
| 48 | + | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| |||
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
136 | 175 | | |
137 | 176 | | |
138 | 177 | | |
| |||
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
171 | 214 | | |
172 | 215 | | |
173 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
558 | 606 | | |
559 | 607 | | |
560 | 608 | | |
| |||
565 | 613 | | |
566 | 614 | | |
567 | 615 | | |
| 616 | + | |
| 617 | + | |
568 | 618 | | |
569 | 619 | | |
570 | 620 | | |
| |||
578 | 628 | | |
579 | 629 | | |
580 | 630 | | |
581 | | - | |
| 631 | + | |
582 | 632 | | |
583 | 633 | | |
584 | 634 | | |
| |||
726 | 776 | | |
727 | 777 | | |
728 | 778 | | |
729 | | - | |
| 779 | + | |
730 | 780 | | |
731 | 781 | | |
732 | 782 | | |
| |||
743 | 793 | | |
744 | 794 | | |
745 | 795 | | |
746 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
747 | 801 | | |
748 | 802 | | |
749 | 803 | | |
750 | | - | |
| 804 | + | |
751 | 805 | | |
752 | 806 | | |
753 | 807 | | |
| |||
1178 | 1232 | | |
1179 | 1233 | | |
1180 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
1181 | 1237 | | |
1182 | 1238 | | |
1183 | 1239 | | |
| |||
0 commit comments