Commit 288f058
Add staged deployment support for control plane restore
Add support for pausing OpenStackControlPlane deployment after
infrastructure creation to enable database restore before OpenStack
services start. This is useful for backup/restore scenarios where
databases need to be restored to empty infrastructure before services
initialize fresh schemas.
**conditions.go:**
- Add OpenStackControlPlaneInfrastructureReadyCondition type
- Add condition messages (Init, Ready, Running, Error, Waiting, Paused)
- Add OpenStackControlPlaneInfrastructureReadyWaitingMessage to show blocking components
- Add OpenStackControlPlaneInfrastructureReadyPausedMessage for infrastructure-only mode
- Infrastructure includes: CAs, DNSMasq, RabbitMQ, Galera, Memcached, OVN
**openstackcontrolplane_types.go:**
- Add DeploymentStageAnnotation constant ("core.openstack.org/deployment-stage")
- Add DeploymentStageInfrastructureOnly constant ("infrastructure-only")
- Add InfrastructureReady condition to InitConditions()
**Enhanced infrastructure status reporting:**
- isInfrastructureReady(): Returns ready status AND list of not-ready components
- Always checks: CAs (no enabled flag)
- Conditionally checks: DNS, RabbitMQ, Galera, Memcached, OVN (only if enabled)
- Returns which components are blocking when infrastructure not ready
- Fixes test failures when OVN or other components are disabled
- InfrastructureReady condition shows detailed waiting message:
- "Infrastructure in progress - waiting for: RabbitMQs, Galeras"
- Makes debugging deployment issues much easier
**Ready condition handling in infrastructure-only mode:**
- Defer block now checks for infrastructure-only mode
- When infrastructure-only AND infrastructure ready:
- Mirror InfrastructureReady pause message to Ready condition (as False)
- Prevents service conditions (Unknown/Init) from leaking into Ready
- When infrastructure not ready OR normal mode:
- Use default mirror behavior (first not-ready condition)
- Result: Ready condition shows appropriate message at each stage
**Staged deployment logic:**
- Move OVN reconciliation to infrastructure section (before services)
- Check deployment-stage annotation after infrastructure reconciliation
- When annotation = "infrastructure-only":
- Set InfrastructureReady condition with pause message
- Set Ready condition to False with pause message (via defer block)
- Return early (skip service reconciliation)
- Message: "Infrastructure ready - deployment paused. Remove annotation to resume deployment of OpenStack services"
- When annotation not set (normal deployment):
- Set InfrastructureReady condition with standard message
- Continue with full service reconciliation
- Message: "Infrastructure ready"
- When infrastructure still deploying:
- Set InfrastructureReady = False/Requested
- Message: "Infrastructure in progress - waiting for: <components>"
**Kuttl test for staged deployment:**
- New test: test/kuttl/tests/ctlplane-staged-deployment/
- Validates full workflow:
1. Deploy with infrastructure-only annotation
2. Assert infrastructure ready, services Unknown, Ready shows pause message
3. Remove annotation
4. Assert full controlplane reaches Ready
- Tests the pause/resume cycle for backup/restore scenarios
Update all kuttl test assertions to expect InfrastructureReady condition:
- common/assert-sample-deployment.yaml
- ctlplane-basic-deployment/03-assert-deploy-custom-cacert.yaml
- ctlplane-collapsed/01-assert-collapsed-cell.yaml
- ctlplane-galera-3replicas/01-assert-galera-3replicas.yaml
- ctlplane-tls-cert-rotation/00-assert-deploy-openstack.yaml
- ctlplane-tls-cert-rotation/03-assert-new-certs.yaml
- ctlplane-tls-custom-issuers/01-assert-deploy-openstack.yaml
- ctlplane-tls-custom-issuers/09-assert-deploy-openstack.yaml
- ctlplane-tls-custom-route/03-assert-deploy-openstack.yaml
This allows a workflow like this, which can be used for backup/restore:
1. Apply OpenStackControlPlane CR with annotation:
core.openstack.org/deployment-stage: infrastructure-only
2. Wait for InfrastructureReady condition:
oc wait --for=condition=InfrastructureReady openstackcontrolplane/openstack
3. Restore databases (MariaDB, OVN) to empty infrastructure
4. Restore RabbitMQ user credentials for EDPM compatibility
5. Remove annotation to resume deployment:
oc annotate openstackcontrolplane openstack core.openstack.org/deployment-stage-
6. Services start with already-restored databases
Jira: OSPRH-25752
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Signed-off-by: Martin Schuppert <[email protected]>1 parent 5258795 commit 288f058
File tree
18 files changed
+310
-8
lines changed- api/core/v1beta1
- internal/controller/core
- test/kuttl
- common
- tests
- ctlplane-basic-deployment
- ctlplane-collapsed
- ctlplane-galera-3replicas
- ctlplane-staged-deployment
- ctlplane-tls-cert-rotation
- ctlplane-tls-custom-issuers
- ctlplane-tls-custom-route
18 files changed
+310
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
510 | 533 | | |
511 | 534 | | |
512 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
951 | 956 | | |
952 | 957 | | |
953 | 958 | | |
| 959 | + | |
954 | 960 | | |
955 | 961 | | |
956 | 962 | | |
| |||
Lines changed: 104 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | | - | |
190 | | - | |
191 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
| |||
386 | 401 | | |
387 | 402 | | |
388 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
389 | 434 | | |
390 | 435 | | |
391 | 436 | | |
| |||
402 | 447 | | |
403 | 448 | | |
404 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
405 | 455 | | |
406 | 456 | | |
407 | 457 | | |
| |||
437 | 487 | | |
438 | 488 | | |
439 | 489 | | |
440 | | - | |
| 490 | + | |
| 491 | + | |
441 | 492 | | |
442 | 493 | | |
443 | 494 | | |
444 | 495 | | |
445 | 496 | | |
446 | 497 | | |
447 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
448 | 542 | | |
449 | 543 | | |
450 | 544 | | |
451 | 545 | | |
452 | 546 | | |
453 | 547 | | |
454 | | - | |
| 548 | + | |
455 | 549 | | |
456 | 550 | | |
457 | 551 | | |
458 | 552 | | |
459 | 553 | | |
460 | 554 | | |
461 | | - | |
| 555 | + | |
462 | 556 | | |
463 | 557 | | |
464 | 558 | | |
465 | 559 | | |
466 | 560 | | |
467 | 561 | | |
468 | | - | |
| 562 | + | |
469 | 563 | | |
470 | 564 | | |
471 | 565 | | |
472 | 566 | | |
473 | 567 | | |
474 | 568 | | |
| 569 | + | |
| 570 | + | |
475 | 571 | | |
476 | 572 | | |
477 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments